[Konsole-devel] [Bug 203185] Wrong reported terminal dimensions when using the "-e" option

Sergei Ivanov svivanov at pdmi.ras.ru
Tue Mar 8 22:00:09 UTC 2011


https://bugs.kde.org/show_bug.cgi?id=203185


Sergei Ivanov <svivanov at pdmi.ras.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |svivanov at pdmi.ras.ru




--- Comment #14 from Sergei Ivanov <svivanov pdmi ras ru>  2011-03-08 23:00:08 ---
I see this bug in KDE 4.6.1 (kubuntu PPA packages) and have some experimental
data showing that it is a race condition.

First, I tried 'konsole -e mc' on two machines and only one of them (an older
and slower one) showed the bug (9 times out of 10). I've  found that a reliable
test is not with mc but with stty. To reproduce, run

  konsole --hold -e stty -a

The first line of stty output (appearing in a new konsole window) is:

  speed 38400 baud; rows 0; columns 0; line = 0;

which is obviously wrong. What is interesting is that if I add a small delay
before stty, like this:

  konsole --hold -e sh -c 'sleep 0.1 && stty -a'

I get the correct output from stty:

  speed 38400 baud; rows 30; columns 80; line = 0;

Adding a similar delay before mc invocation also fixes this bug (on the machine
where mc is affected).

My guess is that 'konsole -e ...' launches the command before its
pseudo-terminal is fully set up, and then reports the 0x0 terminal size for
some period of time. Later (when the konsole window fininshes its
initialization) the PTY is filled with correct dimensions but it's too late if
the application has already read the  terminal size from the PTY.

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the konsole-devel mailing list