Re: Interactive commands cant be backgrounded if run from bashrc

2021-09-02 Thread C. Yang
Ah, I understand it now. Thanks for explaining it to me so patiently. This also means my issue is resolved. Thank you all again for your help!Best, Cheshire On Thu, 02 Sep 2021 18:44:36 -0400 Chet Ramey wrote On 9/2/21 5:06 PM, C. Yang wrote: > Could yo

Re: Interactive commands cant be backgrounded if run from bashrc

2021-09-02 Thread Chet Ramey
On 9/2/21 5:06 PM, C. Yang wrote: Could you please explain why? I thought the reason for the behavior described in my original post was that bash does not complete initialization until .bashrc completes, which doesn't happen until the emacs process started from within it completes? OK. You s

Re: Interactive commands cant be backgrounded if run from bashrc

2021-09-02 Thread C. Yang
Could you please explain why? I thought the reason for the behavior described in my original post was that bash does not complete initialization until .bashrc completes, which doesn't happen until the emacs process started from within it completes? And it sounds

Re: Interactive commands cant be backgrounded if run from bashrc

2021-09-02 Thread Chet Ramey
On 9/2/21 12:15 PM, C. Yang wrote: > However, is it possible that there may be further unexpected consequences, > since bash is still waiting to complete initialization this entire time? > > For instance, if I stop and background emacs, then I find myself back to > the bash > shell. But technical

Re: Interactive commands cant be backgrounded if run from bashrc

2021-09-02 Thread Greg Wooledge
On Thu, Sep 02, 2021 at 12:15:35PM -0400, C. Yang wrote: > I can confirm that adding `set -m` before the emacs command in .bashrc results > > in the behavior I want with CTRL+Z. As I understand, `set -m` will enable job > > control features. This suffices for my use case. > > > > However, is

Re: Interactive commands cant be backgrounded if run from bashrc

2021-09-02 Thread C. Yang
Hi Dale and Chet, Thank you both for your responses and clarifications. Yes, I would like emacs to behave as if I had typed it in the command line, in particular, to be able to stop and background it in the usual way. I can confirm that adding `set -m` before the emacs command in .bashrc

Re: Interactive commands cant be backgrounded if run from bashrc

2021-09-02 Thread Chet Ramey
On 9/1/21 2:10 PM, C. Yang wrote: > Machine: x86_64 > OS: linux-gnu > Compiler: gcc > Description: > >   Whenever I start my session, I'd like to automatically open emacs to a > specific file. > >   So, I added the emacs command to the bottom of my ~/.bashrc file. This > opens emacs > >   c

Re: Interactive commands cant be backgrounded if run from bashrc

2021-09-01 Thread Greg Wooledge
On Wed, Sep 01, 2021 at 09:28:55PM -0500, Dennis Williamson wrote: > On Wed, Sep 1, 2021, 8:42 PM Greg Wooledge wrote: > > I tested with "set -m" and "vim & fg" just now, and it appeared to work. > > Do processes started in .bashrc have a terminal? I would suspect that > something without a try w

Re: Interactive commands cant be backgrounded if run from bashrc

2021-09-01 Thread Dennis Williamson
On Wed, Sep 1, 2021, 8:42 PM Greg Wooledge wrote: > On Wed, Sep 01, 2021 at 09:37:02PM -0400, Dale R. Worley wrote: > > "C. Yang" writes: > > > emacs test.txt & > > > > > > fg > > > > > bash: fg: no job control > > > It sounds like Bash doesn't activate the job-control features until > > .bashrc

Re: Interactive commands cant be backgrounded if run from bashrc

2021-09-01 Thread Greg Wooledge
On Wed, Sep 01, 2021 at 09:37:02PM -0400, Dale R. Worley wrote: > "C. Yang" writes: > > emacs test.txt & > > > > fg > > > bash: fg: no job control > It sounds like Bash doesn't activate the job-control features until > .bashrc is completed. Well, there's an easy fix for that. Just put "set -m"

Re: Interactive commands cant be backgrounded if run from bashrc

2021-09-01 Thread Dale R. Worley
"C. Yang" 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 pr

Interactive commands cant be backgrounded if run from bashrc

2021-09-01 Thread C. Yang
From: cheshire (he...@cheryllium.com) To: mailto:bug-bash@gnu.org Subject: Interactive commands cant be backgrounded if run from bashrc   Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -g -O2 -fdebug