开发者

Customizing the Bash prompt to include number of suspended processes

开发者 https://www.devze.com 2023-02-20 01:44 出处:网络
I\'ve read this article and would like to append to my prompt the number of processes I\'ve currently suspended by pressing ctrl + z . According to that list I have to use the

I've read this article and would like to append to my prompt the number of processes I've currently suspended by pressing ctrl + z . According to that list I have to use the

\j

to be able to accomplish this. Ideally, I would like to append a

:(number)

to my prompt that would be red and bold if its greater than zero and regular and white if it was zero. If this "if" behavior is not possible, then I could just have it always white and 开发者_JS百科regular text. Could anyone help me out with this? Below is the output of my PS1 variable.

faramir@dev:~/testDir$ echo $PS1
\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$

Thanks!


PS1='...:\[$(((\j > 0))&&{ tput setaf 1;tput bold;})\]\j\[$(tput sgr0)\]...'
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号