Open atagen opened 5 days ago
Coincidentally, I've been thinking about adding a few enhancements to fg
too. Such as supporting %
prefixes like Bash (et al) do.
So it wouldn't take any extra effort to make fg
default to %1
if no parameters are supplied.
Nice!
Perhaps a touch bikesheddy but IMO Bash-esque %
prefixes can induce extra cognitive load when you're juggling more than 1-2 processes. If you're already going that route, would you consider perhaps %partialprocessname
, ie. fg %py
could foreground the process called by python my_web_server.py
? (Of course, preferring errors to ambiguity, so if there are two bg python processes we don't act.)
I could easily add support for partial process names without the %
prefix. Basically the logic would go:
%
prefixed integer? If so, follow Bash's format (for people with Bash muscle memory)
Describe the problem: When only one job is in the background, it seems excessive to require the PID/FID to reactivate it - the user can only really mean one thing by typing
fg
.Possible ways to implement: Automatically foreground process on
fg
when there is only a single job.Documentation: Please rate your success with referring to the docs @ https://murex.rocks