Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: $! on bg



On Oct 26,  6:39pm, Peter Stephenson wrote:
}
} It's hard to see any compatilibity problems arising with this since bg
} is mostly used at the command line, but maybe Bart or someone else can
} think of problems.

The only case where this could possibly cause confusion is if someone
has deliberately started a non-interactive shell with "setopt monitor".
I don't think that's frequent enough, or the resulting problem severe
enough, to worry about.
 
} I haven't attempted to lever this into Sven's hack whereby the
} shell can fork and allow you to put a job that was running
} into the current shell into the background; however, it "might just
} work", since the fudged job should already be in the job table by the
} time you do "bg".

No, it does not appear to work.  Try e.g.

zsh% while sleep 10; do : ; done
^Z
zsh: suspended  while sleep 10; do; :; done
zsh% bg ; echo $!
0
zsh% 



Messages sorted by: Reverse Date, Date, Thread, Author