Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

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

Open
Dongsoon-Shin opened this issue Sep 5, 2019 · 1 comment
Open

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

Dongsoon-Shin opened this issue Sep 5, 2019 · 1 comment

Comments

@Dongsoon-Shin
Copy link

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.

@romkatv
Copy link

romkatv commented Sep 5, 2019

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants