Red Hat Bugzilla – Bug 596671
'stty sane' breaks cbreak mode in /usr/bin/less
Last modified: 2013-01-17 12:30:45 EST
Description of problem:
'stty sane' in /etc/profile.d/local.csh breaks cbreak mode in less and commands will not be executed before a newline is sent.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Insert the line 'stty sane' in /etc/profile.d/local.csh
2. login with tcsh as default shell
3. run 'less /etc/termcap' and press space button to scroll
Text is not scrolled before a newline is sent
Text should scroll down immediately when a space is sent
Does not happen if the variable LESSOPEN is unset or set to an empty string
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.
I could reproduce the bug, let's check the source codes for screen refresh while using 'stty sane'.
The component has changed its owner to me, so I'm assigning the bug to myself.
After investigating the issue and discussion with the upstream, I'm changing the component to tcsh as it is a WONTFIX for me - the only place where this could be fixed is the shell.
For more information, see http://greenwoodsoftware.com/less/faq.html#profileout .
The description there is only related to scripts with output, but in its meaning, it extends to changing stty settings, too.
Basically, the problem is less changes the terminal features in runtime and invoking tcsh during it causes it to run all the profile scripts such as /etc/profile.d/local.csh . This is however not a standard behavior of all shells, for example bash doesn't do it at all.
I asked tcsh upstream about changing this behavior and got a negative response. This is a WONTFIX for tcsh.
Explanation here http://mx.gw.com/pipermail/tcsh/2013-January/004620.html.