How to deactivate bash_history stats print when opening a new terminal window on my mac?

与世无争的帅哥 提交于 2019-12-04 17:51:38

I've had the same problem, and have tracked it down to having the touch NPM/Node package installed globally on the system, which places an alternative touch command in your PATH.

$ ls -l $(which touch) lrwxr-xr-x 1 timshel admin 74 18 Jul 12:47 /usr/local/bin/touch -> ../../../Users/timshel/.config/yarn/global/node_modules/touch/bin/touch.js

(I've used yarn global add to install packages on my system rather than npm install -g)

On my system, a simple $ rm /usr/local/bin/touch fixed the issue (I think the touch NPM package got installed as a dependency on my system; it isn't even installed properly).

Also, the reason you only observed this in Apple Terminal is that the touch command which causes the Stat data to be printed is located in /etc/bashrc_Apple_Terminal; which is only loaded in Apple Terminal by the following line in /etc/bashrc:

[ -r "/etc/bashrc_$TERM_PROGRAM" ] && . "/etc/bashrc_$TERM_PROGRAM"

/etc/bashrc_Apple_Terminal isn't loaded in other terminal emulators (e.g. your platformioIDE example).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!