问题
This is a simple C program:
This is the result of that program -- note the % at the end.
回答1:
zsh prints a % (by default for a normal user) when the last line does not end with a newline character. This partial line could be erased by the prompt otherwise. Add a newline to properly terminate the last line (\n):
printf("1\n");
http://zsh.sourceforge.net/Doc/Release/Options.html#index-PROMPT_005fSP
来源:https://stackoverflow.com/questions/50918949/zsh-print-automatically-after-the-result-of-the-c-program