bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Interactive commands cant be backgrounded if run from bashrc


From: Chet Ramey
Subject: Re: Interactive commands cant be backgrounded if run from bashrc
Date: Thu, 2 Sep 2021 10:25:15 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

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
> 
>   correctly when I start the session.
> 
>  
> 
>   Normally, when I start emacs, I can background the process with CTRL+Z, and 
> foreground
> 
>   with `fg` command. When emacs is started from .bashrc as above, pressing 
> CTRL+Z does
> 
>   not correctly background the process. Instead, the terminal session goes 
> blank and
> 
>   becomes unresponsive.

Bash doesn't initialize job control until after reading the startup files,
which are executed in a nominally non-interactive environment.

You can force that initialization by running `set -m'. It may work for your
purposes.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]