Bug 245746

Summary: Konsole inverts $COLUMNS and $LINES when resized from vi
Product: [Applications] konsole Reporter: Alain BAECKEROOT <alain.baeckeroot>
Component: generalAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED DUPLICATE    
Severity: normal CC: adaptee, the_shark
Priority: NOR Keywords: testcase
Version: 2.3.2   
Target Milestone: ---   
Platform: Unlisted Binaries   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: call setImageSize() with the right order of lines and columns parameter

Description Alain BAECKEROOT 2010-07-25 15:02:00 UTC
Version:           2.3.2 (using KDE 4.3.2) 
OS:                Linux

This simple command does a resize from vi (enlarge by 3 columns)

$ resize; vi /tmp/a +"set co=$(($COLUMNS + 3))" +:q; echo; resize
COLUMNS=84;
LINES=45;
export COLUMNS LINES;

COLUMNS=45;
LINES=87;
export COLUMNS LINES;
We see that Konsole inverts $COLUMNS and $LINES !

this works flawlessly in gnome-terminal 2.28, has no effect in xterm or xfce4-terminal, and just messup every thing in konsole until the window is resized with the mouse (then correct values are taken into account)



Reproducible: Always

Steps to Reproduce:
$ resize; vi /tmp/a +"set co=$(($COLUMNS + 3))" +:q; echo; resize
Comment 1 Alain BAECKEROOT 2011-02-03 23:20:46 UTC
same problem in Konsole 2.4.5 using KDE 4.4.5
Comment 2 Kurt Hindenburg 2011-03-06 20:12:14 UTC
*** Bug 187875 has been marked as a duplicate of this bug. ***
Comment 3 Jekyll Wu 2011-07-16 15:47:06 UTC
Created attachment 61923 [details]
call setImageSize() with the right order of lines and columns parameter

I can reproduce this with 2.7.999.

The cause of this problem is quite trival: one line within Vt102Emulation.cpp calls setImagesize() with the order of lines and columns parameter swapped.  The attached patch simply make it use the right order. 

However, it seems currently konsole does not support resizing from terminal process(vi, etc). The COLUMNS and LINES environment variables are updated, by the konsole window does not actually change its size .
Comment 4 Kurt Hindenburg 2011-07-18 00:47:08 UTC
Yes, thanks - I also have the patch around somewhere.  I think I had tried to get the resizing to work (as it did once) and forgot about the col/row change.

I'll get to it shortly.
Comment 5 Kurt Hindenburg 2011-07-19 02:40:38 UTC
Git commit c252666b98b405a54f0551c5a6632daea29ad230 by Kurt Hindenburg.
Committed on 19/07/2011 at 04:39.
Pushed by hindenburg into branch 'master'.

Fix $COLUMNS/$LINES after resizing.

The 2 were inverted previously.
CCBUG: 245746

M  +1    -1    src/Vt102Emulation.cpp

http://commits.kde.org/konsole/c252666b98b405a54f0551c5a6632daea29ad230
Comment 6 Jekyll Wu 2011-08-03 15:18:26 UTC

*** This bug has been marked as a duplicate of bug 238073 ***
Comment 7 Kurt Hindenburg 2011-08-25 13:33:40 UTC
Git commit eb9691d3f6a324c1801531ff2d3960b3656665fb by Kurt Hindenburg.
Committed on 19/07/2011 at 04:39.
Pushed by hindenburg into branch 'KDE/4.7'.

Fix $COLUMNS/$LINES after resizing.

The 2 were inverted previously.
CCBUG: 245746
(cherry picked from commit c252666b98b405a54f0551c5a6632daea29ad230)

M  +1    -1    src/Vt102Emulation.cpp

http://commits.kde.org/konsole/eb9691d3f6a324c1801531ff2d3960b3656665fb