"C. Yang" <he...@cheryllium.com> writes: > This may be because the bashrc file is still running, and bash itself > perhaps does not finish initializing until everything in the bashrc > completes. This may be why CTRL+Z does not work correctly (it might > require bash to finish initializing first)
I'm sure that's the problem in your first case: If you put "emacs foo.bar" in .bashrc, it instructs Bash to run Emacs, wait until the job completes, and implicitly: finish processing .bashrc, then start listening to the terminal. It gets messier because the processing of ctrl-Z is done in the kernel, manipulating the state of processes, but it's possible that Bash doesn't activate job control in the terminal handler until processing .bashrc is finished. In any case, I wouldn't expect this case to work like you want. > emacs test.txt & > > fg > The first line, instead of backgrounding emacs, appeared to run it > simultaneously with bash. This had the consequence that both bash and > emacs were taking the same Uh, "backgrounding" *is* "run it simultaneously*. I think what you mean is "stop and background it", which is what ctrl-Z does. > bash: fg: no job control It sounds like Bash doesn't activate the job-control features until .bashrc is completed. It sounds like what you want is for the last thing .bashrc (or more likely, .bash_login) does is to start an Emacs that acts exactly as if you typed "emacs" at the prompt. In particular, you want to be able to background it in the ordinary way, which seems to require that Bash has finished processing .bashrc. Dale