bug-bash
[Top][All Lists]
Advanced

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

Incorrect readline's idea of the screen size


From: Marc Bevand
Subject: Incorrect readline's idea of the screen size
Date: Fri, 12 Jul 2002 07:02:36 +0200 (MEST)

Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib -g -O2
uname output: Linux alpha 2.4.18-ck4 #23 Tue Jul 2 05:36:44 CEST 2002 i686 
unknown
Machine Type: i686-pc-linux-gnu

Bash Version: 2.05a
Patch Level: 0
Release Status: release

Description:
        Readline's idea of the screen size is incorrect after resizing
        the terminal while bash is a background process.

Repeat-By:
        0. Suppose your terminal width is 80 columns
        1. Execute 'cat'
        2. Resize your terminal to 85 columns
        3. Exit 'cat' with ^D
        4. Write a line so that your cursor goes beyond the 80th column
        5. Constat the bug: the cursor does not jump to the line below,
          but instead overwrites the beginning of the current line

Fix:
        A quick look at the source code shows that
        rl_sigwinch_handler() is called on SIGWINCH. But this signal
        is not sent to bash while it's in background.
        A quick hack would be:
          0. Save the current terminal size just before placing
            another process group in foreground
          1. When bash comes back to foreground, compare the
            new current terminal size with the old one.
          2. If they differ, call rl_sigwinch_handler()

-- 
Marc Bevand       -[ bevand_m :: a2 SRS :: promo 2k3 :: lfs id 2678 ]-
               "I hope life isn't a big joke, because I don't get it."




reply via email to

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