3 ms·
zsh has completion for kill, pkill, etc. out of the box. The default for kill is to only shown processes from the current pty, but you can change that with some
by arp242 3y ago
zsh has completion for kill, pkill, etc. out of the box. The default for kill is to only shown processes from the current pty, but you can change that with something like:
zstyle ':completion:*:*:kill:*:processes' command 'ps xo pid,user:10,cmd'
I also filter some processes that I almost never want to kill to clean it a bit up:
zstyle ':completion:*:*:kill:*:processes' command 'ps xo pid,user:10,cmd | grep -Ev "(ps xo|firefox|/bin/zsh|-zsh|runsv)"'
As with most things in zsh, you can make it as fancy as you want, but this is enough for me.
zsh is really powerful, but the downside is that a lot of these things have a bit of a "magic incantation factor" unless you're pretty familiar with zsh scripting. I guess this is why people use oh-my-zsh and things like that.
- sureglymop 3y agoThe main issue I always have is that as soon as I have to use another system or ssh into another system I lose all of that.
- arp242 3y agoCan't have it all I'm afraid. For this reason I keep my zshrc contained to one file so I can easily move it around, but it does require zsh to be available in the first place of course. All things considered, I'd rather optimize for the 99% of the time I'm on my local machine than the 1% I'm on a remote machine.