powerlevel9k icon indicating copy to clipboard operation
powerlevel9k copied to clipboard

Disappear the last line when using without a new line (\n)

Open Dongsoon-Shin opened this issue 6 years ago • 1 comments

Hi, this is not a serious bug. However, It bothers me.

OS: Ubuntu 16.04 This is my .zshrc configuration

POWERLEVEL9K_MODE='awesome-fontconfig'
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX="↱"
POWERLEVEL9K_PROMPT_ON_NEWLINE=true  
POWERLEVEL9K_RPROMPT_ON_NEWLINE=true  
POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="↳ "  
POWERLEVEL9K_PROMPT_ADD_NEWLINE=true

and I typed this code for testing.

#include <stdio.h>
main() { 
int a,b;
scanf("%d %d, &a, &b);
printf("%d", a+b);
}

then I compiled with clang and GCC. I was guessed that if put the 5 8, this program will show that 13. However, I show the result like that:

image

The result is disappeared. However, in bash, this result appears.

image

I guess this is a bug. So, I report this bug.

Dongsoon-Shin avatar Sep 05 '19 08:09 Dongsoon-Shin

This is the expected ZSH behavior with options no_prompt_sp and prompt_cr. You can observe it by typing zsh -df --no_prompt_sp --prompt_cr and then echo -n 'hello\nbye'. It's almost always a bad idea to use this set of options.

You can get the same behavior in ZSH as in Bash with no_prompt_sp and no_prompt_cr. It is quite terrible and is unlikely to appeal to anyone.

The best combination is prompt_sp and prompt_cr, which is also the default. So the practical advice is to either add setopt prompt_sp at the end of your ~/.zshrc or remove whatever it is that unsets this option in the first place.

romkatv avatar Sep 05 '19 15:09 romkatv