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

Martin von Gagern Martin.vGagern at gmx.net
Wed Apr 6 08:07:29 UTC 2011


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


Martin von Gagern <Martin.vGagern at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Martin.vGagern at gmx.net




--- Comment #15 from Martin von Gagern <Martin vGagern gmx net>  2011-04-06 10:07:27 ---
(In reply to comment #14)
> 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.

I agree. The following app will query the window size repeatedly; only the
first time will report the 0x0 size.

#include <stdio.h>
#include <sys/ioctl.h>
#include <termios.h>

int main( void )
{
    struct winsize size;
    for (;;) {
        size.ws_col = size.ws_row = 0;
        if (ioctl(0, TIOCGWINSZ, &size) < 0) {
            printf("Error: ioctl failed.\n");
            return 1;
        }
        printf("Terminal size: %dx%d\n", size.ws_col, size.ws_row);
        printf("[ENTER to continue, Ctrl+D to quit.]");
        if (getchar() == EOF)
            return 0;
    }
}

I guess konsole should init its pty info from its startup geometry, but I
haven't looked what the code for this looks like.

-- 
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