Bug 596671

Summary: 'stty sane' breaks cbreak mode in /usr/bin/less
Product: Red Hat Enterprise Linux 5 Reporter: Olle Liljenzin <olle>
Component: tcshAssignee: Roman Kollár <rkollar>
Status: CLOSED WONTFIX QA Contact: BaseOS QE - Apps <qe-baseos-apps>
Severity: medium Docs Contact:
Priority: low    
Version: 5.5CC: mbriza, ovasik
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-17 17:30:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Olle Liljenzin 2010-05-27 09:44:06 UTC
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):
less-436-2.el5

How reproducible:
Always

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
  
Actual results:
Text is not scrolled before a newline is sent

Expected results:
Text should scroll down immediately when a space is sent

Additional info:
Does not happen if the variable LESSOPEN is unset or set to an empty string

Comment 1 RHEL Program Management 2011-05-31 14:14:57 UTC
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.

Comment 2 Vojtech Vitek 2012-03-07 17:20:00 UTC
I could reproduce the bug, let's check the source codes for screen refresh while using 'stty sane'.

Comment 3 Martin Bříza 2012-06-06 13:16:19 UTC
The component has changed its owner to me, so I'm assigning the bug to myself.

Comment 4 RHEL Program Management 2012-06-12 01:04:00 UTC
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.

Comment 5 Martin Bříza 2012-12-21 08:37:41 UTC
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.

Comment 6 Roman Kollár 2013-01-17 17:30:45 UTC
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.