andrewchambers / janetsh

A powerful new shell that uses the janet programming language for both the implementation and repl.
https://janet-shell.org
MIT License
372 stars 13 forks source link

Implicit fg arg. #132

Open andrewchambers opened 5 years ago

andrewchambers commented 5 years ago

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.

bakpakin commented 5 years ago

I just have a function in my rc file:

(defn fg
 "Reload first foreground job."
 []
 (sh/fg-job (first sh/jobs)))
andrewchambers commented 5 years ago

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 commented 5 years ago

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

andrewchambers commented 5 years ago

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