gnome-terminal frequently misses SIGWINCH/window resize events
Submitted by Evan Klitzke
Link to original bug (#790426)
Description
I am using Fedora 27 with Wayland and gnome-terminal (3.26.2 according to dnf). I regularly (multiple times a day) have issues where text is wrapped incorrectly while typing at the prompt in interactive bash sessions.
Usually this is caused by incorrect escaping of ANSI color codes in PS1, as readline needs the escape sequences to calculate the display width of the prompt. After triple checking that my PS1 is escaped correctly, I noticed the following. When the issue occurs, I get the bash pid from $$ and then GDB attach to that pid from another terminal. From GDB I see that _rl_screenwidth is 80, even though the terminal is in fact wider than this. If I manually kill -WINCH the bash pid, I see that _rl_screenwidth is updated and the wrapping problem goes away. This makes me suspect that the root cause is that SIGWINCH events are not always being delivered when terminal windows are resized.
I would love to give more debugging information here, but I'm not sure what I should be trying to collect. Do you have any suggestions?
Version: 3.26.x
Resolution: RESOLVED NOTGNOME