Hyper: % (percent sign) showing up while using oh-my-zsh

Created on 31 Aug 2017  ·  29Comments  ·  Source: vercel/hyper

OS: Ubuntu 17.04

It happens only for first tab opened in hyper.

Screenshot

Bug

Most helpful comment

adding this unsetopt PROMPT_SP to my .zshrc helped
reference

All 29 comments

I have a similar bug with fish!

First tab:
image

Second tab (or after cmd+k):
image

This is du to the session shell invoking. Since we print the window before creating the required IPC connectors.

Can't this be cleared at start for first tab?

Actually no. It buffer your input and emit it once it's ready. If you type before it's complete you will have the % sign.

No, I am saying can Hyper detect that zsh is ready? Once it detects that, it clears the terminal.

Don't know how but VS Code's terminal is able to handle it

VS Code uses xterm, we currently use hterm as our terminal library, that's why VS Code is better in many ways, and why we're in progress of migrating to xterm @ajitid

adding this unsetopt PROMPT_SP to my .zshrc helped
reference

That's a good workaround, but I think we should fix the issue so that hyper handles the row correctly

@albinekb I'm not using Hyper at present. Is this issue resolved in Hyper 2.0?

yes, fixed in v2 🎉 @ajitid

The issue is back in version 3.0.0.

The issue is back in version 3.0.0 but adding unsetopt PROMPT_SP to .zshrc seems to fix it.

I've added unsetopt PROMPT_SP to my .zshrc and that fixed it. Is that the permanent solution or should this be fixed on Zeit's end?

This helped me understand the problem. https://unix.stackexchange.com/a/167600

version 3.0.2 same problem. 😟

# .zshrc
# fix Hyper first line precent sign

unsetopt PROMPT_SP

Can also confirm that it was fixed in 2.x, but came back with 3.0.0.

Using the workaround unsetopt PROMPT_SP for now.

The issue is back in version 3.0.0 but adding unsetopt PROMPT_SP to .zshrc seems to fix it.

This is not a fix, just a workaround

I'm currently seeing this issue in 3.0.2. Interestingly it shows up in the vscode integrated terminal as well.

I think its caused by an applications stdout piping without a finish line..
my setup:
gnome terminal, ubuntu 18,
ZSH_THEME="powerlevel9k/powerlevel9k"

....
mike@i  ~  echo -n hi  ✔  10003  07:44:30
hi% mike@i  ~ 

in other words.. doing echo -n text will print 'text%' if you perform unset PROMPT_SP then you will never see the hi or text part

I just finished reading the links and this page explains it perfectly...
https://superuser.com/questions/645599/why-is-a-percent-sign-appearing-before-each-prompt-on-zsh-in-windows

If you use this configuration you will keep your lines, and get rid of the character. The character was meant to be a feature...

setopt PROMPT_CR
setopt PROMPT_SP
export PROMPT_EOL_MARK=""

Why is this closed? Is there a fix (not workaround)?

@rafael-paiva This was a version 2 bug; a new thread was created for the new v3 bug: #3586 😀

Thanks for the unsetopt PROMPT_SP trick -- this suddenly became an issue for me as OS X pushed me off bash to zsh. I'd been meaning to try it for ages anyhow, and this was the nudge I needed I guess...

I have the same issue when I am not using hyper (using iTerm) but only when loading inside of TMUX... I load my ZSH session exactly the same way outside and inside the TMUX but I am getting the % only when in TMUX session ...

on the image below the right-side displays, the % after loading ZSH directly from TMUX and the left was showing the same % but after invoking ZSH again manually it's not displayed
Capture d’écran, le 2020-01-23 à 03 30 57

I have the same issue when I am not using hyper (using iTerm) but only when loading inside of TMUX... I load my ZSH session exactly the same way outside and inside the TMUX but I am getting the % only when in TMUX session ...

on the image below the right-side displays, the % after loading ZSH directly from TMUX and the left was showing the same % but after invoking ZSH again manually it's not displayed
Capture d’écran, le 2020-01-23 à 03 30 57

I should have read the comment before sending my comment I am sorry ~>

PROMPT_SP
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.

NOTE: if the PROMPT_CR option is not set, enabling this option will have no effect. This option is on by default.

It doesn't happen in the canary 3.1.0

I'm having this problem on the latest commits, since today. unsetopt PROMPT_SP does not fix the problem

@francogp check the note by @Luxcium about PROMPT_CR, that might help.

I started seeing this recently, too. I switched to the canary channel, and it doesn't show up, but as soon as I start typing I lose my prompt and all the terminal text is invisible, so I switched back to stable.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stan-stripe picture stan-stripe  ·  3Comments

laur1s picture laur1s  ·  3Comments

anthonyettinger picture anthonyettinger  ·  3Comments

ConstantinChirila picture ConstantinChirila  ·  3Comments

yvan-sraka picture yvan-sraka  ·  3Comments