Bug 828877

Summary: xterm resizing does not pass to all sub clients
Product: [openSUSE] openSUSE 12.3 Reporter: Marcus Meissner <meissner>
Component: X11 ApplicationsAssignee: Marcus Meissner <meissner>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P5 - None CC: dickey, dvaleev, gleixner, haenig, jdelvare, jreuter, lmb, sndirsch, vuntz, werner
Version: Final   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Marcus Meissner 2013-07-10 14:30:08 UTC
the running bash within xterm does not always get the resize events.


reproduce:

$ echo $COLUMNS
80
$    (resize terminal)
echo $COLUMNS
118
$ less .bashrc
... keep it open and resize xterm againb ... 
... quit less
$ echo $COLUMNS
118
$

Somehow the contained bash does not receive the window size changes when another process is running.
Comment 1 Marcus Meissner 2013-07-10 14:34:22 UTC
when less is running,

strace -p BASHPID 

only gives an unchanging:

wait4(-1,

I however do not see it blocking SIGWINCH
Comment 2 Thomas Dickey 2013-07-10 23:40:36 UTC
As I recall the various reports over the years, bash is blocking SIGWINCH in
some manner, and it checks for updates.

https://www.google.com/search?q=bash+sigwinch&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a
Comment 3 Thomas Dickey 2013-07-10 23:41:39 UTC
Also 
http://www.faqs.org/faqs/unix-faq/shell/bash/
Comment 4 Dr. Werner Fink 2013-07-11 06:27:39 UTC
(In reply to comment #3)

Fronm this URL

| When bash is running with job control enabled, each pipeline (which may be
| a single command) is run in its own process group, different from bash's
| process group.  This foreground process group receives the SIGWINCH; bash
| does not.  Bash has no way of knowing that the terminal has been resized.
Comment 5 Lars Marowsky-Bree 2013-07-11 15:53:49 UTC
Can't bash query the terminal after command execution? (TIOCGWINSZ)
Comment 6 Thomas Fehr 2013-07-11 16:01:33 UTC
I doubt bash is at fault here.
Just use another terminal (e.g. mlterm) and the behavior does not show
up in spite of the same bash running.
Comment 7 Dinar Valeev 2013-07-11 16:04:21 UTC
I'm facing that problem with gnome-terminal
Comment 8 Lars Marowsky-Bree 2013-07-11 16:12:03 UTC
I'm facing the problem with konsole and gnome-terminal.
Comment 9 Dr. Werner Fink 2013-07-12 07:43:54 UTC
It is up on the user to use

   shopt -s checkwinsize

but I'll *not* do this by default as otherwise the bug #793536 become reopen as in case of checkwinsize enabled the variables LINES and COLUMNS will be exported.
This is an upstream decision and I'll not gonna change that.

From manual page

         checkwinsize
                  If set, bash checks the window size after each command and,
                  if necessary, updates the values of LINES and COLUMNS.
Comment 10 Lars Marowsky-Bree 2013-07-12 07:48:47 UTC
Werner, pointing me at that option has made me very, very happy. Thank you!
Comment 11 Marcus Meissner 2013-07-12 08:53:07 UTC
*** Bug 825487 has been marked as a duplicate of this bug. ***
Comment 12 Bernhard Wiedemann 2013-07-12 13:00:15 UTC
This is an autogenerated message for OBS integration:
This bug (828877) was mentioned in
https://build.opensuse.org/request/show/182922 Factory / bash
https://build.opensuse.org/request/show/182923 Factory / bash
Comment 13 Bernhard Wiedemann 2013-07-22 12:01:24 UTC
This is an autogenerated message for OBS integration:
This bug (828877) was mentioned in
https://build.opensuse.org/request/show/183978 Maintenance / 
https://build.opensuse.org/request/show/183979 Maintenance /
Comment 14 Marcus Meissner 2013-07-29 09:41:55 UTC
was found to be a bash problem (not xterm) in the end.

and is fixed
Comment 15 Swamp Workflow Management 2013-07-29 13:07:05 UTC
openSUSE-RU-2013:1271-1: An update that has 7 recommended fixes can now be installed.

Category: recommended (low)
Bug References: 382214,763591,793536,804551,806628,820149,828877
CVE References: 
Sources used:
openSUSE 12.2 (src):    bash-4.2-51.13.1
Comment 16 Dr. Werner Fink 2013-09-18 07:45:25 UTC
*** Bug 839132 has been marked as a duplicate of this bug. ***
Comment 17 Bernhard Wiedemann 2014-01-15 11:00:18 UTC
This is an autogenerated message for OBS integration:
This bug (828877) was mentioned in
https://build.opensuse.org/request/show/213960 12.3 / bash
Comment 18 Swamp Workflow Management 2014-01-22 10:04:38 UTC
openSUSE-RU-2014:0117-1: An update that has two recommended fixes can now be installed.

Category: recommended (low)
Bug References: 820149,828877
CVE References: 
Sources used:
openSUSE 12.3 (src):    bash-4.2-61.4.1