bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

xterm window resize and getch


From: Sandro Sigala
Subject: xterm window resize and getch
Date: Sat, 25 Aug 2001 13:21:37 +0200 (CEST)

Hi!  During the development of my Zile editor, I came with this odd
behavior.

When you resize two times a xterm window and you press a key, the key get
lost.  This happens in getch() blocking mode only.

Please find attached a test program (just compile it
with "gcc -o t t.c -lncurses").

Try typing "foo" RESIZE "bar" RESIZE RESIZE "helloq" (where RESIZE
means resize the xterm window) and the test program will dump into a
"t.out" file the following:

################
got 102 'f'
got 111 'o'
got 111 'o'
resized to 31, 101              (or something like)
got KEY_RESIZE
got 98 'b'
got 97 'a'
got 114 'r'
resized to 31, 82
resized to 31, 104
resized to 31, 104              <-- this should not happen
got KEY_RESIZE
got KEY_RESIZE
got KEY_RESIZE                  <-- this should not happen
got 101 'e'                     <-- where is the 'h' key?
got 108 'l'
got 108 'l'
got 111 'o'
got 113 'q'

Interesting enough, if you uncomment the two lines marked in the t.c file,
you will get the following (witch is correct):

################
got 102 'f'
got 111 'o'
got 111 'o'
resized to 31, 76
got KEY_RESIZE
got 98 'b'
got 97 'a'
got 114 'r'
resized to 31, 92
got KEY_RESIZE
resized to 31, 82
got KEY_RESIZE
got 104 'h'
got 101 'e'
got 108 'l'
got 108 'l'
got 111 'o'
got 113 'q'

Regards,
        Sandro

Attachment: t.c
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]