Powerlevel9k: Way to align right hand segments with edge of terminal

Created on 7 Oct 2015  路  10Comments  路  Source: Powerlevel9k/powerlevel9k

Using this theme with gnome terminal I am finding there is a one character gap between the right hand segment and the edge of the terminal. Is there any way to get rid of this?

zshissue

Most helpful comment

ZLE_RPROMPT_INDENT=-1 works in many cases. Give it a try.

All 10 comments

@keirlawson the right hand indent is controlled by the variable ZLE_RPROMPT_INDENT in ZSH. I tried once to get rid of the gap by setting it to 0, but it messed up the cursor position. I haven't had time to fix this yet.

From the manpage:

ZLE_RPROMPT_INDENT
If set, used to give the indentation between the right hand side of the right prompt in the line editor as given by RPS1 or RPROMPT and the right hand side of the screen. If not set, the value 1 is used.
Typically this will be used to set the value to 0 so that the prompt appears flush with the right hand side of the screen. This is not the default as many terminals do not handle this correctly, in particular when the prompt appears at the extreme bottom right of the screen. Recent virtual terminals are more likely to handle this case correctly.

Some experimentation is necessary.

For the protocol: There was an interesting conversation on the mailing list in late 2013 about how to simulate the behavior of ZLE_RPROMPT_INDENT. About the same time there was a bug report about that issue.

@keirlawson - It's not just a problem with gnome-terminal - it actually exists in a every emulator I have used ZSH in, to date. As @dritter said, it seems to be a ZSH drawing issue.

@dritter - I don't think we can work around this safely in our theme, as it will change from emulator to emulator. Do you agree? If so, I'm afraid this bug is something we can't address.

Unfortunately, I don't think this is something we can fix in our theme.

Is this something that still can't be fixed?

@Pk13055 Unfortunately not from our side. At least not easy. There are workarounds out there, but I haven't tested these in a long time.. Also, I haven't tried setting ZLE_RPROMPT_INDENT=0 since then. It might work for you. Did you try it out?

ZLE_RPROMPT_INDENT=-1 works in many cases. Give it a try.

@softmoth Setting it to -1 works... but why? 馃槅 Might have to do some digging on that one.

Edit: It looks like the lack of empty space in the rightmost column confuses Terminal.app (macOS 10.14.4) when using GUI-level functions related to clearing text (e.g.: Clear to Start, Clear to Previous Mark, etc.)

Screen Shot 2019-04-03 at 12 52 06
Screen Shot 2019-04-03 at 12 56 26
Screen Shot 2019-04-03 at 12 59 18
Screen Shot 2019-04-03 at 13 00 10

@macserv, there's a workaround in #871. It's already added to powerlevel9k though, so you shouldn't be having the extra space.

Ha! I thought something like that might be possible, but I was trying it with a null (\u0000), and that didn鈥檛 work.

Anyway, I haven鈥檛 pulled in a while, so I鈥檒l check and see if that鈥檚 had an effect. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DanielChabrowski picture DanielChabrowski  路  3Comments

yoyoys picture yoyoys  路  3Comments

iiison picture iiison  路  3Comments

shibumi picture shibumi  路  3Comments

agungsetiawan picture agungsetiawan  路  6Comments