lenmom

博客园 首页 新随笔 联系 订阅 管理

How to remove the return code from the terminal prompt

 

In addition to the PS1 environment variable, the PROMPT_COMMAND environment variable also affects your prompt. From the bash man page:

If set, the value is executed as a command prior to issuing each primary prompt

It is that command that is adding the unwanted content to your prompt. You can stop that behavior by unsetting the variable in your .bashrc:

unset PROMPT_COMMAND

 具体做法为:

vi ~/.bashrc

在下面加入unset PROMPT_COMMAND,如图:

 

posted on 2018-08-30 11:18  老董  阅读(1435)  评论(0编辑  收藏  举报