Skip to content
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

No way to reflect command failure in character.vicmd_symbol #2967

Open
lilyball opened this issue Aug 7, 2021 · 1 comment
Open

No way to reflect command failure in character.vicmd_symbol #2967

lilyball opened this issue Aug 7, 2021 · 1 comment
Labels
🐛 bug Something isn't working as expected.

Comments

@lilyball
Copy link

lilyball commented Aug 7, 2021

Bug Report

Current Behavior

The character module defines:

[character]
format = '$symbol '
success_symbol = '[❯](bold green)'
error_symbol = '[❯](bold red)'
vicmd_symbol = '[❮](bold green)'

This means that in vi normal mode, the failure status cannot be shown. Since the status module is disabled by default, this means going into vi normal mode hides the status.

Expected Behavior

The config should have a way of showing success/error state in vi normal mode.

Possible Solution

The config should probably look something like

[character]
format = '[$symbol]($style) '
success_symbol = ''
success_style = 'bold green'
# error_symbol = unset, defaults to success_symbol
error_style = 'bold red'
vicmd_symbol = ''
# vicmd_style = unset, defaults to error_style or success_style as appropriate

The only thing I don't see how to do offhand is to let the user disable vicmd_symbol (in case they don't actually want the mode displayed this way), since toml has no null. We could say "set it to false" but that's very hacky. Or maybe we could define $insert_symbol as a variable available when evaluating $vicmd_symbol so I can set vicmd_symbol = '$insert_symbol'. Or just add a vi_disabled = false key. I don't know if there's any other precedent for this situation in starship.

Alternatively we could add vicmd_success_symbol and vicmd_error_symbol but that seems much more unwieldy, and isn't backwards-compatible (existing setups that modified vicmd_symbol will have their changes stop applying after an error).

@lilyball lilyball added the 🐛 bug Something isn't working as expected. label Aug 7, 2021
@IzhakJakov
Copy link
Contributor

Hi @lilyball

You can apply my PR and try this workaround if you like:

[character]
vicmd_symbol = ''
success_symbol = ''
error_symbol = ''

[status]
format = '$symbol$success_symbol'
symbol = "[✗](bold red)"
success_symbol = "[✔️](green)"
disabled = false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working as expected.
Projects
None yet
Development

No branches or pull requests

2 participants