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

Add a new option to trim the prompt #5914

Open
kkpattern opened this issue Apr 8, 2024 · 0 comments
Open

Add a new option to trim the prompt #5914

kkpattern opened this issue Apr 8, 2024 · 0 comments
Labels
✨ enhancement A new feature implementation.

Comments

@kkpattern
Copy link

Feature Request

Is your feature request related to a problem? Please describe.

Thanks for this awesome tool. Currently, I have the following config:

format = """
$cmd_duration\
$line_break\
$hostname\
...
"""

I put cmd_duration on a separate line so that it can be more intuitively seen that it's the cost of the previous command:

starship on  trim_prompt
❯ nvim C:\Users\kyler\.config\starship.toml

took 58s
starship on  trim_prompt
❯

But it will leave an extra empty line if cmd_duration is not shown.

Describe the solution you'd like

We can add a new option, trim_prompt. When it's true, starship will trim the prompt, so there will be no extra empty line in the above case. The default value can be set to false for back compatibility.

I have a proof-of-concept implementation here: kkpattern@5800c6b. If this is OK, I'd happy to refine the code and prepare a PR.

Thanks.

@kkpattern kkpattern added the ✨ enhancement A new feature implementation. label Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement A new feature implementation.
Projects
None yet
Development

No branches or pull requests

1 participant