-
Notifications
You must be signed in to change notification settings - Fork 482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
monitor: add common shell features to dev prompt #1289
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
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). Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
SGTM, thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be super useful 🎉 The approach LGTM 😄
I like the splash of color in it - ideally we'd sync up with the buildkit colors in some way. Autocompletion would also be excellent to add at some point once we've stabilized what all the monitor mode commands would be.
} | ||
|
||
prompt.New(exec, completer, prompt.OptionHistory([]string{ | ||
"reload", "rollback", "exit", "help", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sets the history at the beginning? I think we probably should just leave this empty (maybe a future enhancement to save the history to ~/.buildx/monitor_history
or similar?)
@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 6e05092 |
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. |
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