monitor: add common shell features to dev prompt
This makes the monitor mode from —invoke more user friendly by enabling features user might expect from dev shell.
Interactive mode now has colors, history and keyboard control for movement (arrows, moving to beginning/end, by word, emacs controls etc).
Opening as draft. If this solution (and base library it uses) seems desirable then some updates are needed in go-prompt (or fork) to make it more configurable (currently made changes in vendor).
@ktock
SGTM, thank you!
@tonistiigi what changes would be needed in go-prompt? Would it be feasible to try and take this for v0.11?
see the changes in vendor https://github.com/docker/buildx/pull/1289/commits/6e05092055d20af2bded2b5c9fdca9a7b53512cb
Looking through go-prompt, the maintainer seems inactive, so it seems likely we'd probably have to fork if we need changes.
Looking through go-prompt, the maintainer seems inactive, so it seems likely we'd probably have to fork if we need changes.
https://github.com/erikgeiser/promptkit and https://github.com/charmbracelet/bubbletea looks to be reliable alternatives.