5 ms·
Some good ideas there. I wonder if the autocomplete for `kill` could be scripted for other shells.
by ape4 3y ago
Some good ideas there.
I wonder if the autocomplete for `kill` could be scripted for other shells.
- n8henrie 3y agoIf you're an fzf user, its integration for `kill *<tab>` has been a game changer.
- DiabloD3 3y agotbf, thats an existing bash-complete-ism, fzf.bash just makes it cooler.
- Rediscover 3y agoMy own, personal, use-case is to completely nuke `bash-complet*` off my machine. To me, bash-completion is horrible. I am looking for a tarball to unwind, and I only remember that it it started with "foo-" and it sure did not end in ".tar" (trying to save keystrokes, y'know). Trying C-i does not pull up anything. Argghh. I am on a machine with bash-completion! --- I often hit C-a then "a" to get an invalid command (still saved to my hist), or C-a C-k if I think there is nothing else going into the kill-ring. bash-completion absolutely messes with me. If it works for You, that is great. I really dislike it.
- n8henrie 3y agoHuh, I had no idea. Just `kill <tab>` then? Will give it a shot next time I'm ak.
- DiabloD3 3y ago`kill <tab>` will list all pids, `killall <tab>` lists every process name. fzf.bash just turns `kill` into `ps (args) | fzf`, and does not yet have an equivalent for `killall`.
- zeroonetwothree 3y agoI’m just curious why you need to kill stuff so often. I think I probably do it once a month at most.
- bee_rider 3y agoNot the person you responded to, but I probably kill an octave or matlab terminal daily. Oops, it turns out this matrix is too big to solve directly. Oops, norm2 takes forever and norm1 would have been good enough.
- hnlmorg 3y agoI suspect they're talking about fzf in general, using `kill` as an example, rather than saying they `kill` stuff often. But I could have misinterpreted their comment.
- n8henrie 3y agoI didn't mean to imply that I use it "so often," just that it makes it much easier when I do. I have to `kill -9` neovim once or twice per week due to <https://neovim.discourse.group/t/how-to-debug-intermittent-neovim-freezes/2225 https://neovim.discourse.group/t/how-to-debug-intermittent-n...>, that's probably the most frequent culprit. I really need to compile a debug version and help get that sorted.
- arp242 3y agozsh 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.
- ComputerGuru 3y agoFish autocompletes kill, fg, bg, killall, etc out-of-the-box already.