janetsh icon indicating copy to clipboard operation
janetsh copied to clipboard

Implicit fg arg.

Open andrewchambers opened this issue 6 years ago • 4 comments

When you background something with ctrl-z running (fg-job) with no arg may be useful. Perhaps some last-job variable may also be useful.

andrewchambers avatar May 25 '19 11:05 andrewchambers

I just have a function in my rc file:

(defn fg
 "Reload first foreground job."
 []
 (sh/fg-job (first sh/jobs)))

bakpakin avatar May 25 '19 23:05 bakpakin

I'll have to double check the job code to see if new jobs are put in the front or the back. I think things get more complicated when the user has lots of jobs and is swapping them back and forth.

andrewchambers avatar May 25 '19 23:05 andrewchambers

Added (sh/fg) which simply foregrounds the last foreground job to be stopped.

andrewchambers avatar Jun 01 '19 12:06 andrewchambers

Unclear what the semantics of this should be, especially when user prompts run jobs to do work.

andrewchambers avatar Jun 01 '19 12:06 andrewchambers