[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
problems using trap 'eval `resize`' SIGWINCH
From: |
eddy |
Subject: |
problems using trap 'eval `resize`' SIGWINCH |
Date: |
Tue, 30 Oct 2001 19:51:54 +0000 (GMT) |
Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-pc-linux-gnu'
-DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H -D_FILE_OFFSET_BITS=64 -I.
-I/usr/include -I/home/swt/doko/export/packages/bash/bash-2.05
-I/home/swt/doko/export/packages/bash/bash-2.05/include
-I/home/swt/doko/export/packages/bash/bash-2.05/lib -I/usr/include -g -O2
uname output: Linux vortex 2.2.19 #1 Thu Apr 19 22:35:28 EST 2001 i686 unknown
Machine Type: i386-pc-linux-gnu
Bash Version: 2.05
Patch Level: 0
Release Status: release
Description:
I have, for years, been trapping SIGWINCH with 'eval `resize`'
and it worked fine: i.e. I never noticed it was happening, but
COLUMNS and LINES always had sensible values (they still do,
fortunately).
Lately, I've been having the problem illustrated below. After
a window resize operation, bash is in some weird state where
it's buffering up my input as if for a command, but not acting
on it until I ^D or type a lone semi-colon. After the first
line of input, it (does nothing and) comes back with $PS1;
after the second, it (does nothing and) comes back with $PS2.
Resizing after first input but before second puts the command
typed into the command history and resets our PS number.
Interaction with up-arrow while in the mangled state is weirder.
Using kill -WINCH $$ doesn't activate the problem, so I can
only reproduce it inside an xterm. Turning off trapping of
WINCH removes the problem; trapping it with another command
reinstates the problem. Hitting return after a resize
suppresses the problem (i.e. is a work-around; so severity of
this bug is `minor', I guess).
I'm running bash inside an xterm under fvwm2 on debian.
I'm totally confused by this behaviour !
Repeat-By:
eddy:vortex> trap 'eval `resize`' SIGWINCH
# resize window, by clicking the `maximise vertical' button,
eddy:vortex> clear
# notice that this hasn't happened so try again
eddy:vortex> clear
:>
# perplexed, hit return; $PS2 appears again;
# being puzzled, type ^D
:> bash: syntax error: unexpected end of file
# hit up-arrow (but no return)
eddy:vortex> clear; clear;
# ^U that and type
eddy:vortex> resize
COLUMNS=80;
LINES=24;
export COLUMNS LINES;
eddy:vortex> echo $PS1
\u:\h>
eddy:vortex> echo $PS2
:>
eddy:vortex> echo $IGNOREEOF
1
eddy:vortex> clear
# OK, clear worked this time;
# do a resize by dragging window corner, then type
eddy:vortex> clear
eddy:vortex> clear
:> clear
:> clear
:> clear
:> clear
:> clear
:> ;
bash: syntax error near unexpected token `;'
# $PS1 re-appears; hit up-arrow (but no return)
eddy:vortex> clear; clear; clear; clear; clear; clear; clear; ;
# ^U, type
eddy:vortex> clear
# window clears, $PS1 re-appears; resize window, type ^D
eddy:vortex> Use "exit" to leave the shell.
# $PS1 re-appears; type clear
eddy:vortex> clear
# window clears, $PS1 re-appears; resize, type ;
eddy:vortex> ;
bash: syntax error near unexpected token `;'
eddy:vortex> clear
# window clears, $PS1 re-appears; resize; type
eddy:vortex> echo hello
# nothing echoed; hit up-arrow and return
eddy:vortex> echo hello
# nothing echoed; hit up-arrow and return
:> echo hello; echo hello
# nothing echoed; hit up-arrow and return
:> echo hello; echo hello; echo hello; echo hello
# that's quite enough of that; ^D the next $PS2
:> bash: syntax error: unexpected end of file
eddy:vortex> kill -WINCH $$
eddy:vortex> clear
# window clears !
eddy:vortex> trap '' WINCH
# resize window
eddy:vortex> clear
# window clears !
eddy:vortex> trap 'echo mumble' WINCH
# maximise vertical
eddy:vortex> mumble
# unmaximise vertical
eddy:vortex> mumble
# that's output we've seen emitted; now type
clear
# and type it again
eddy:vortex> clear
# and again
:> clear
# so hit up-arrow and return
:> clear; clear; clear
# so ^D the next $PS2
:> bash: syntax error: unexpected end of file
eddy:vortex> clear
# window clears
eddy:vortex> trap 'eval `resize`' WINCH
# resize, hit return
eddy:vortex>
# nothing happened, sensibly enough; type
eddy:vortex> clear
# window clears !
eddy:vortex> echo hello
hello
# maximise vertical, type
eddy:vortex> clear
# didn't do it; unmaximise vertical; up-arrow and return
eddy:vortex> clear
# didn't do it; maximise, up;
eddy:vortex> clear
# didn't; unmax, up;
eddy:vortex> clear
# didn't; max, up;
eddy:vortex> clear
# didn't; up-arrow (no return)
:> clear; clear
# up-arrow again (still no return)
:> clear
# same for next several, until
:> echo hello
# so hit return this time; get $PS2, type ^D
:> bash: syntax error: unexpected end of file
# get $PS1, type up-arrow (no return)
eddy:vortex> clear; clear; echo hello;
# further up-arrows reveal the
# sequence of lone clears preceded by echo.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- problems using trap 'eval `resize`' SIGWINCH,
eddy <=