How can I have "names" for my background processes (not just the command)?
0
votes
1
answer
582
views
I run a lot of vim windows, and often put them in the bg. The problem is that they all say
vim
when I list jobs
so it's hard to distinguish.
- suspended nvim
- suspended nvim
+ suspended nvim
One way around this is to open a specific file when starting vim:
nvim ./myfile
jobs
:
+ suspended nvim myfile
But this is a poor substitute for a name.
Another option is to (mis)use env vars like this to name the buffer:
vim name=my_name
But the output of jobs
could be more usable, and has the disadvantage of needing to preparing for the possibly unneeded backgrounding of the process at the moment of staring the process.
- suspended nvim name=my_name
+ suspended nvim name=other_name
Ideally I'd like to be asked to give the process an optional name when I press ctl-z
. Perhaps there's a plugin out there that handles this, but I haven't found it.
I would consider writing it myself, but I wouldn't know where to start. Presumably by re-mapping ctl-z
to some other program? And maybe I'd have to write something that sites in front of fg
and jobs
as well to control the output...
Any suggestions for this?
Asked by pixelearth
(101 rep)
Apr 29, 2023, 02:49 PM
Last activity: Apr 29, 2023, 08:01 PM
Last activity: Apr 29, 2023, 08:01 PM