agnoster / agnoster-zsh-theme

A ZSH theme designed to disclose information contextually, with a powerline aesthetic
4k stars 588 forks source link

Only show gear icon for applications tied to a terminal #61

Open Hassan-Shabbir opened 6 years ago

Hassan-Shabbir commented 6 years ago

I usually spawn applications from my terminal by wrapping the command in a nohup and &, for example nohup vlc blah.mp4 &. This still shows the gear icon even though the application is not running in the background nor is it tied to that specific terminal window. To change this behaviour I changed line 210 from [[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}⚙" to [[ $(jobs -l | sed '/nohup/d' | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}⚙" so that commands started with nohup are not included in the check for background processes.

apjanke commented 4 years ago

FYI, I added this on my AgnosterJ fork: https://github.com/apjanke/agnosterj-zsh-theme/commit/7eea1870231141dbe63c56fa81157c2344f9b2b1