-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat(prompt): allow custom override for command prompt and filter prompt #3399
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
base: master
Are you sure you want to change the base?
Conversation
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.
@martinblascop I think this make sense.
We do currently use a different border color to differentiate between cmd vs filter modes.
That said I am not sure this warrants the extra configs? Since we could just change the default behavior to use '>' or '/' to be the defaults icons supported or not.
Would this make sense?
README.md
Outdated
@@ -431,6 +431,10 @@ You can now override the context portForward default address configuration by se | |||
logoless: false | |||
# Set to true to hide K9s crumbs. Default false | |||
crumbsless: false | |||
# Set custom prompt in command mode. Default to '>' |
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.
nit: perhaps best to use commandPromptPrefix
...
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.
agree
internal/ui/prompt.go
Outdated
//nolint:exhaustive | ||
switch k { | ||
case model.CommandBuffer: | ||
return userCustomSymbolPrompt(p.app.Config.K9s.GetCommandPromptSymbol()) |
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.
I think it might be best to keep prompt configuration all in the configuration.
Thus p.app.Config.K9s.GetPromptPrefix
will return either the default prefix or the customized one vs having the prompt figure this out.
Would this make better sense?
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.
Yes, that makes sense
60b725c
to
44fad2f
Compare
I'd love to have |
@derailed I think I have addressed your suggestions, is there something missing? |
For terminals that support emojis, you can have different emojis from command mode and filter mode, giving you a hint in which mode you are, but some terminals do not support emojis.
Add support for custom prompt symbols in command and filter mode, to differentiate them, enhancing a bit the user experience.