0

This is minor but it's driving me crazy.

My prompt is followed by an inverse bolded % like so:

https://i.stack.imgur.com/Lkx36.png

I want it to go away.

I am using: zsh with oh-my-zsh on iterm2

What I have tried:

I found this and according to the accepted answer this is caused by PROPMT_SP as explained in the zsh manual:

Attempt to preserve a partial line (i.e. a line that did not end with a newline) that would otherwise be covered up by the command prompt due to the PROMPT_CR option. This works by outputting some cursor-control characters, including a series of spaces, that should make the terminal wrap to the next line when a partial line is present (note that this is only successful if your terminal has automatic margins, which is typical).

When a partial line is preserved, by default you will see an inverse+bold character at the end of the partial line: a % for a normal user or a # for root. If set, the shell parameter PROMPT_EOL_MARK can be used to customize how the end of partial lines are shown.

Following the accepted answer I entered this into the terminal:

unsetopt PROMPT_SP

and restarted. This didn't work, so I continued to try:

setopt PROMPT_CR
setopt PROMPT_SP
export PROMPT_EOL_MARK=""

and restarted. This didn't work so i added

setopt PROMPT_CR
setopt PROMPT_SP
export PROMPT_EOL_MARK=""

into my ~/.zshrc and restarted this didn't work.

Going down to the other answer: The other answer suggested adding those into your selected .zsh-theme and add the above lines. I did not have one selected and according to this the default theme is robbyrussell.zsh-theme, so I added the above lines into ~/.oh-my-zsh/themes/robbyrussell.zsh-theme and that didn't work. I deleted those lines and changed the theme in my ~/.zshrc to blinks.zsh-theme and added the above lines to ~/.oh-my-zsh/themes/blinks.zsh-theme and restarted and that didn't work.

Once all of this did not work I searched again on Google and only found this which was more of the same solutions that have not worked so far for me.

What am I doing wrong?

  • As your screenshot does only show a single, non-bold, non-inverse % at the end of the prompt, I have to ask: You are indeed asking about the % that might appears after the output if it does not end with a newline character? For example after the output of echo -n 'foo'. – Adaephon Nov 23 '17 at 12:22
  • Yes that's the one I'm asking about – Diego Nov 23 '17 at 22:13
  • Running setopt PROMPT_CR PROMPT_SP; PROMPT_EOL_MARK="" should have an immediate effect in the current shell session. (Do not restart the shell, as these changes are not persistent!) To make it persistent, adding it to your ~/.zshrc is the right way. It would probably best to add it at the very and of the ~/.zshrc to ensure that the settings are not overwritten by anything else. – Adaephon Nov 24 '17 at 7:17

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.