[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bash-bug
Subject:    Re: set -o notify spurious CR when jobs redirected to file
From:       "Ian! D. Allen" <idallen () idallen ! ca>
Date:       2014-11-14 19:15:58
Message-ID: 20141114191558.GB22054 () idallen ! ca
[Download RAW message or body]

On Fri, Nov 14, 2014 at 10:30:12AM -0500, Chet Ramey wrote:
> Yes, it's intended.  Piotr identified the code that does this.  If the
> shell is currently interactive, it can't be sure under what circumstances
> it's printing a job notification.

If the shell is printing the job notification because a user has typed
"jobs" at the command line, there is no uncertainty on the part of the
user that the resulting output does not need the extra CR.

Perhaps the shell code isn't written to recognize that the request comes
from a "jobs" command, but there is no uncertainty from the perspective of
the user typing "jobs".  Output generated directly as a result of typing
"jobs" does not need the extra CR.

Now, I can imagine implementations of "jobs" that might make it hard
to communicate this case to the job notify code, but that would be
a shortcoming in the recognition of the circumstances, not a lack of
clarity in what the circumstances are.

In short, it's still a bug.

One might mitigate the bug by refusing to add the CR if output is not
a TTY.  That would refrain from creating what look like DOS-format files.

-- 
| Ian! D. Allen  -  idallen@idallen.ca  -  Ottawa, Ontario, Canada
| Home Page: http://idallen.com/   Contact Improv: http://contactimprov.ca/
| College professor (Free/Libre GNU+Linux) at: http://teaching.idallen.com/
| Defend digital freedom:  http://eff.org/  and have fun:  http://fools.ca/


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic