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

% (percent sign) showing up while using oh-my-zsh #2144

Closed
ajitid opened this issue Aug 31, 2017 · 30 comments
Closed

% (percent sign) showing up while using oh-my-zsh #2144

ajitid opened this issue Aug 31, 2017 · 30 comments
Labels
🐛 Type: Bug Issue pertains to something wrong within Hyper

Comments

@ajitid
Copy link

ajitid commented Aug 31, 2017

OS: Ubuntu 17.04

It happens only for first tab opened in hyper.

Screenshot

@ajitid ajitid changed the title % (percent sign) showing up while using zsh % (percent sign) showing up while using oh-my-zsh Aug 31, 2017
@albinekb albinekb added the 🐛 Type: Bug Issue pertains to something wrong within Hyper label Aug 31, 2017
@albinekb
Copy link
Contributor

albinekb commented Aug 31, 2017

I have a similar bug with fish!

First tab:
image

Second tab (or after cmd+k):
image

@ppot
Copy link
Contributor

ppot commented Sep 1, 2017

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

@ajitid
Copy link
Author

ajitid commented Sep 1, 2017

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

@ppot
Copy link
Contributor

ppot commented Sep 1, 2017

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.

@ajitid
Copy link
Author

ajitid commented Sep 1, 2017

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

@ajitid
Copy link
Author

ajitid commented Sep 1, 2017

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

@albinekb
Copy link
Contributor

albinekb commented Sep 1, 2017

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

@infctr
Copy link

infctr commented Sep 2, 2017

adding this unsetopt PROMPT_SP to my .zshrc helped
reference

@albinekb
Copy link
Contributor

albinekb commented Sep 4, 2017

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

@ajitid
Copy link
Author

ajitid commented Sep 28, 2017

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

@Stanzilla Stanzilla mentioned this issue Jan 23, 2018
8 tasks
@albinekb
Copy link
Contributor

yes, fixed in v2 🎉 @ajitid

@saintjcob
Copy link

The issue is back in version 3.0.0.

@Barben360
Copy link

Barben360 commented May 6, 2019

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

@chris-c-thomas
Copy link

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?

@meatherly
Copy link

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

@ifyour
Copy link

ifyour commented May 25, 2019

version 3.0.2 same problem. 😟

# .zshrc
# fix Hyper first line precent sign

unsetopt PROMPT_SP

@imtbl
Copy link

imtbl commented Jun 19, 2019

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.

@zachbryant
Copy link

zachbryant commented Jun 20, 2019

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

@zachauten
Copy link

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

@mikeguidry
Copy link

mikeguidry commented Aug 1, 2019

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=""

@rafaelbnp
Copy link

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

@rsha256
Copy link

rsha256 commented Sep 12, 2019

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

@edsu
Copy link

edsu commented Oct 18, 2019

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

@Luxcium
Copy link

Luxcium commented Jan 23, 2020

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

@Luxcium
Copy link

Luxcium commented Jan 23, 2020

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.

@fernandopasik
Copy link

It doesn't happen in the canary 3.1.0

@francogp
Copy link

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

@LabhanshAgrawal
Copy link
Collaborator

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

@Liquidmantis
Copy link

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.

@iruma-kun
Copy link

another workaround is adding "clear" to zshrc, but might cause issues if u wanna see session restoration and welcome messeges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Type: Bug Issue pertains to something wrong within Hyper
Projects
None yet
Development

No branches or pull requests