3 ms·
Using head -c 16 will show an ugly '%' at the string end when not piped.
by lobocinza 5y ago
Using head -c 16 will show an ugly '%' at the string end when not piped.
- lucb1e 5y agoRight, I forget that it's not the default to print a \n as the first character of your PS1. Doesn't make sense to me that this isn't the default, as there are quite a few commands that might not end with a newline and then it messes up the prompt position, and it doesn't impact backwards compatibility to add it now.
- mkl 5y agoOn which OS? There it is piped, but I can't make it display a "%" any way (why would it?). I'm on Linux, using head from GNU coreutils.
- lobocinza 5y agoArch Linux. When using Zsh the last char is always a '%'. When using Bash it does no show a '%' but there's no line break. Possibly an weird interaction with my $PS1.
- mkl 5y agoThat's definitely a Zsh thing, showing that there was no newline: https://zsh.sourceforge.io/Doc/Release/Options.html#Prompting https://zsh.sourceforge.io/Doc/Release/Options.html#Promptin.... It's not to do with PS1 or PROMPT, or head.