[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Incorrect readline's idea of the screen size
From: |
Chet Ramey |
Subject: |
Re: Incorrect readline's idea of the screen size |
Date: |
Mon, 15 Jul 2002 09:24:29 -0400 |
> 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()
Why not look at the `checkwinsize' option to `shopt'?
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
Chet Ramey, CWRU chet@po.CWRU.Edu http://cnswww.cns.cwru.edu/~chet/