Open lumaxis opened 6 years ago
bold disabled for section contents like git
information or whole prompt including prefixes and suffixes ?
I would love to have such an option!
bold disabled for section contents like
git
information or whole prompt including prefixes and suffixes ?
IMHO: for all options where you can set the color.
Moving the discussion from #519:
I would like to make this feature to be happen because of personal interest, but I want to align with the current route of the project.
My proposed approach would have a new standard parameter (SPACESHIP_PROMPT_DEFAULT_BOLD
) which could have been overridden in sections.
But as @salmanulfarzy mentioned this would be overkill. I interpret his concerns as this would bring too much complexity on the project for a feature not widely used (correct me if I am wrong). I tend to agree on the latter part, if it's not widely used than the new "API" would overwhelm the documentation for newcomers. I respect his opinion and I understand the notion behind his thoughts so I would follow with a simpler solution (as he suggested):
A new standard parameter (SPACESHIP_PROMPT_BOLD
) would be introduced to globally switch the boldness of the content part of the sections. The keyword here is content - this wouldn't change the behaviour of prefixes and suffixes.
This would be a more subtle change with less risk on the current codebase too.
I looked at the code and this would be easy to implement.
What your thoughts on this? (Mainly addressing the question to @salmanulfarzy)
If we are in a consensus I would follow-up with a WIP pull-request to eliminate the obstacles along the implementation.
Any movement on this? This bolding of the prompt is really annoying. Why should I have to disable bold face globally in iTerm? Shouldn't this be a choice for spaceship? (considering how granularly everything else is configurable?)
Hey @ortonomy, I didn't move on this because wanted to get green light from @salmanulfarzy before implementing any code to avoid later confusion/discrepancies about it.
Any thoughts Salmanul?
While you are waiting for the new option to be implemented, you can add the following snippet at the end of ~/.zshrc
to unbold spaceship prompt.
() {
local z=$'\0'
PROMPT='${${${$(spaceship_prompt)//\%\%/'$z'}//\%B}//'$z'/%%}'
}
This performs 3 replace-all operations on PROMPT
:
%%
with $'\0'
(special value that cannot be present in PROMPT
).%B
with nothing. This removes all boldness.$'\0'
with %%
to restore escaped percents.Enjoy your spaceship prompt!
thanks @romkatv -- A pity I have to disable it globally.
Thanks @romkatv nice workaround.
@romkatv This does not work for the right prompt here, unfortunately.
@dhasilva You can add the same line for RPROMPT
.
@romkatv Thank you, friend. It works! For newbies like me finding this thread:
() {
local z=$'\0'
PROMPT='${${${$(spaceship_prompt)//\%\%/'$z'}//\%B}//'$z'/%%}'
RPROMPT='${${${$(spaceship_rprompt)//\%\%/'$z'}//\%B}//'$z'/%%}'
}
FYI, there are two new issues with the above workaround starting in v4+:
spaceship_[r]prompt
functions have been moved to spaceship::[r]prompt
.$PROMPT
variable directly does not take effect since the async process will replace it immediately after. I tested with SPACESHIP_PROMPT_ASYNC=false
, but it still doesn't work. 🤷
Issue
I'd love for Spaceship to have option to not set
bold
as the default font style for the prompt. What do people think about this? If others are interested in this as well, I'd start prototyping a PR.Screenshot
iTerm with bold fonts globally disabled:
Hyper with the Spaceship default:
Environment
Spaceship version:
3.3.0
Zsh version: zsh 5.3 (x86_64-apple-darwin17.0) Zsh framework: oh-my-zsh Zsh plugin manager: None Terminal emulator: Hyper/iTerm Operating system: macOS