Customize zsh's prompt when displaying previous command exit code

前端 未结 2 1558
梦谈多话
梦谈多话 2021-02-02 06:59

Zsh includes the ability to display the return code/exit code of the previous command in the prompt by using the %? escape sequence.

However I would like to

2条回答
  •  无人共我
    2021-02-02 07:33

    Alternatively, you can:

    setopt PRINT_EXIT_VALUE
    

    to always print a newline showing previous return value.

    I don't prefer this for ordinary use, but it is often good for debugging shell scripts.

提交回复
热议问题