Search code examples
printfzshtext-formattingkonsole

Printf puts a percent sign after everything it prints


Whenever I use printf in the shell whether it is within awk, a standalone application, or in C/C++ it prints a "%" after everything. For instance, when I type printf "hi" I get this as an output hi%. I am on Arch Linux using zsh as a shell and konsole as a terminal emulator. The font I use is MesloLGS NF.

Image:

My Terminal


Solution

  • This is zsh's way of telling you that the preceding command outputted a partial line and the shell terminated that line to give you a prompt on a new line.

    You can disable this behavior by typing PROMPT_EOL_MARK='' into the command prompt.