ZSH在C程序结果后自动打印'%'

时间:2018-06-19 00:02:11

标签: c vim zsh

这是一个简单的C程序:

this is a simple C program

这是该计划的结果 - 请注意最后的%

this is the result of the C program , but here is the '%' at the end .

1 个答案:

答案 0 :(得分:6)

当最后一行没有以换行符结尾时,zsh会打印%(默认情况下为普通用户)。否则可以通过提示擦除该部分线。添加换行符以正确终止最后一行(\n):

printf("1\n");

http://zsh.sourceforge.net/Doc/Release/Options.html#index-PROMPT_005fSP