bug-bash
[Top][All Lists]
Advanced

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

Window resize confuses bash (readline)


From: Mark Lord
Subject: Window resize confuses bash (readline)
Date: Tue, 16 Oct 2001 16:07:49 -0400

Configuration Information [Automatically generated, do not change]:
Machine: i586
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i586' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i586-mandrake-linux-gnu' 
-DCONF_VENDOR='mandrake' -DSHELL -DHAVE_CONFIG_H  -D_GNU_SOURCE 
-D_FILE_OFFSET_BITS=64  -I.  -I. -I./include -I./lib -I/usr/include -O3 
-fomit-frame-pointer -pipe -mcpu=pentiumpro -march=i586 -ffast-math 
-fno-strength-reduce
uname output: Linux tbird.localnet 2.4.12-ac3 #1 Mon Oct 15 19:34:47 EDT 2001 
i686 unknown
Machine Type: i586-mandrake-linux-gnu

Bash Version: 2.05
Patch Level: 1
Release Status: release

Description:
        The built-in readline library of bash gets very confused when
        the shell window is resizes while bash is dormant (eg. viewing a 
manpage).

        The attached patch provides a fix for this problem.

Repeat-By:
        Enter a long commandline to a bash shell, long enough that it
        wraps around within the text (xterm) window.

        Then, in the same window, view a manpage.  Eg.  "man cat"
        While viewing the manpage, resize the window to a larger width.
        Exit from the manpage viewer.

        Use the "up arrow" (linux) to recall the earlier long command line,
        and notice how it is incorrectly displayed, since bash (readline)
        is still assuming the original window size.

        For even more confusion, try using the left arrow to move back along
        the commandline and enter some new characters.  What a mess.

Fix:
        Readline should check for a resized window prior to inputing characters.
        A patch which accomplishes this is included below.

--- bash-2.05/lib/readline/readline.c.orig      Tue Oct 16 14:54:56 2001
+++ bash-2.05/lib/readline/readline.c   Tue Oct 16 15:42:00 2001
@@ -505,6 +505,7 @@
   int eof;

   readline_internal_setup ();
+  rl_resize_terminal();
   eof = readline_internal_charloop ();
   return (readline_internal_teardown (eof));
 }

-- 
Mark Lord
Real-Time Remedies Inc.
mlord@pobox.com



reply via email to

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