This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bash monitor mode remains enabled if disabled in .bashrc


On 8/30/2017 7:26 PM, Michel LaBarre wrote:
> Playing with set -m/+m and shopt -s lastpipe, in an interactive bash shell,
> I came across a situation 
> which is minor unless  it has broader implications for others that I do not
> know about.
> 
> Specifically if "set +m" is present in  .bashrc, it looks like job control
> (monitor mode) is off 
> in an interactive shell (as per "echo $-") but it is actually on.
> 
> I ran into this with "shopt -s lastpipe" behaviour with and without job
> control.
> I can also reproduce it with "sleep 25&" then "fg" will fail with "no job
> control".
> 
> If I "set +m" within the interactive shell rather than, or in addition to,
> .bashrc, both the 
> flags ($-) and behaviour (lastpipe and fg) reflect job control being off.
> 

Are you sure that .bashrc is being sourced?  The initial start of an
interactive shell doesn't read .bashrc by default.  It reads
.bash_profile when starting interactive mode.  Now most likely your
.bash_profile contains lines to check the existence of .bashrc and
source it but you need to check.

-- 
cyg Simple

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]