[vim/vim] Since ab16ad3 / 8.2.3941: Resizing the terminal window can cause Vim to "minimize" like Ctrl-Z (Issue #9586)

3 views
Skip to first unread message

vain

unread,
Jan 21, 2022, 10:44:09 AMJan 21
to vim/vim, Subscribed

Steps to reproduce

  1. Launch an XTerm.
  2. Start vim -u NONE -U NONE
  3. Hit Ctrl-Z once to send Vim into the background. It’s important to do this at least once, the bug won't get triggered otherwise.
  4. On the shell, type fg to bring Vim back.
  5. Resize the XTerm window. As soon as its size changes, Vim gets sent to the background as if I had pressed Ctrl-Z.

When I bring back Vim again now using fg, resizing the window won't trigger the bug anymore until I manually press Ctrl-Z again.

I uploaded a little demo video here: https://gist.github.com/vain/e35a4ec49f921b961d455b93752d1a44

Expected behaviour

Resizing the terminal window should not cause Vim to "minimize".

Version of Vim

8.2.3941

Environment

Arch Linux with kernel 5.16.1, XTerm 370 (but also other terminals, e.g. sakura, alacritty, st), $TERM = xterm-256color, Bash 5.1.016.

Logs and stack traces

strace:



First Ctrl-Z (the intentional one):



    16:22:44.864645 pselect6(1, [0], [], [0], NULL, NULL) = 1 (in [0])

    16:22:46.700380 read(0, "\33[27;5;122~", 4096) = 11

    16:22:46.700607 pselect6(1, [0], [], [0], {tv_sec=0, tv_nsec=0}, NULL) = 0 (Timeout)

    16:22:46.700773 pselect6(1, [0], [], [0], {tv_sec=0, tv_nsec=0}, NULL) = 0 (Timeout)

    16:22:46.700891 pselect6(1, [0], [], [0], {tv_sec=0, tv_nsec=0}, NULL) = 0 (Timeout)

    16:22:46.701009 write(1, "\33[77;1H\r\n", 9) = 9

    16:22:46.701144 write(1, "\33[?2004l\33[?1l\33>", 15) = 15

    16:22:46.701192 write(1, "\33[>4;m\33[?1049l\33[23;0;0t", 23) = 23

    16:22:46.701400 ioctl(0, SNDCTL_TMR_START or TCSETS, {B38400 opost isig icanon echo ...}) = 0

    16:22:46.701454 kill(0, SIGTSTP)        = 0

    16:22:46.701482 --- SIGTSTP {si_signo=SIGTSTP, si_code=SI_USER, si_pid=109977, si_uid=1000} ---

    16:22:46.701501 rt_sigaction(SIGTSTP, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7faa298a1da0}, {sa_handler=0x55ba8a08d470, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7faa298a1da0}, 8) = 0

    16:22:46.701550 rt_sigprocmask(SIG_UNBLOCK, [TSTP], [TSTP], 8) = 0

    16:22:46.701606 rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0

    16:22:46.701636 getpid()                = 109977

    16:22:46.701657 gettid()                = 109977

    16:22:46.701677 tgkill(109977, 109977, SIGTSTP) = 0

    16:22:46.701698 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0

    16:22:46.701720 --- SIGTSTP {si_signo=SIGTSTP, si_code=SI_TKILL, si_pid=109977, si_uid=1000} ---

    16:22:46.701732 --- stopped by SIGTSTP ---



Bringing Vim back with `fg`:



    16:22:51.436244 --- SIGCONT {si_signo=SIGCONT, si_code=SI_USER, si_pid=108582, si_uid=1000} ---

    16:22:51.436290 rt_sigreturn({mask=[]}) = 0

    16:22:51.436437 rt_sigaction(SIGTSTP, {sa_handler=0x55ba8a08d470, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7faa298a1da0}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7faa298a1da0}, 8) = 0

    16:22:51.436485 rt_sigprocmask(SIG_UNBLOCK, [TSTP], [], 8) = 0

    16:22:51.436521 rt_sigreturn({mask=[]}) = 0

    16:22:51.436547 ioctl(0, SNDCTL_TMR_START or TCSETS, {B38400 opost -isig -icanon -echo ...}) = 0

    16:22:51.436586 write(1, "\33[?1049h\33[22;0;0t\33[>4;2m\33[?1h\33=\33"..., 39) = 39

    16:22:51.436624 ioctl(1, TCGETS, {B38400 opost -isig -icanon -echo ...}) = 0

    16:22:51.436648 ioctl(0, TCGETS, {B38400 opost -isig -icanon -echo ...}) = 0

    16:22:51.436671 ioctl(1, TCGETS, {B38400 opost -isig -icanon -echo ...}) = 0

    16:22:51.436693 ioctl(1, TIOCGWINSZ, {ws_row=77, ws_col=156, ws_xpixel=940, ws_ypixel=1005}) = 0

    16:22:51.436814 write(1, "\33[?12h\33[?12l\33[27m\33[23m\33[29m\33[m\33["..., 1996) = 1996

    16:22:51.436900 write(1, "\33[14;1H~                        "..., 2047) = 2047

    16:22:51.436979 write(1, "                                "..., 2028) = 2028

    16:22:51.437056 write(1, "\33[39;1H~                        "..., 2047) = 2047

    16:22:51.437132 write(1, "                                "..., 2028) = 2028

    16:22:51.437208 write(1, "\33[64;1H~                        "..., 2047) = 2047

    16:22:51.437246 write(1, "                                "..., 84) = 84

    16:22:51.437286 pselect6(1, [0], [], [0], {tv_sec=0, tv_nsec=0}, NULL) = 0 (Timeout)

    16:22:51.437320 pselect6(1, [0], [], [0], {tv_sec=4, tv_nsec=0}, NULL) = ? ERESTARTNOHAND (To be restarted if no handler)



Then resizing the window -- note that there's a `kill(0, SIGTSTP)` from Vim itself, this does not happen on 8.2.3940:



    16:22:54.283431 --- SIGWINCH {si_signo=SIGWINCH, si_code=SI_KERNEL} ---

    16:22:54.283503 rt_sigaction(SIGWINCH, {sa_handler=0x55ba8a08d3e0, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7faa298a1da0}, {sa_handler=0x55ba8a08d3e0, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7faa298a1da0}, 8) = 0

    16:22:54.283676 rt_sigprocmask(SIG_UNBLOCK, [WINCH], [WINCH], 8) = 0

    16:22:54.283855 rt_sigreturn({mask=[]}) = -1 EINTR (Interrupted system call)

    16:22:54.283972 write(1, "\33[77;1H\r\n", 9) = 9

    16:22:54.284008 write(1, "\33[m\33[?2004l\33[?1l\33>", 18) = 18

    16:22:54.284039 write(1, "\33[>4;m\33[?1049l\33[23;0;0t", 23) = 23

    16:22:54.284069 ioctl(0, SNDCTL_TMR_START or TCSETS, {B38400 opost isig icanon echo ...}) = 0

    16:22:54.284102 kill(0, SIGTSTP)        = 0

    16:22:54.284125 --- SIGTSTP {si_signo=SIGTSTP, si_code=SI_USER, si_pid=109977, si_uid=1000} ---

    16:22:54.284140 rt_sigaction(SIGTSTP, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7faa298a1da0}, {sa_handler=0x55ba8a08d470, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7faa298a1da0}, 8) = 0

    16:22:54.284374 rt_sigprocmask(SIG_UNBLOCK, [TSTP], [TSTP], 8) = 0

    16:22:54.284424 rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0

    16:22:54.284455 getpid()                = 109977

    16:22:54.284477 gettid()                = 109977

    16:22:54.284497 tgkill(109977, 109977, SIGTSTP) = 0

    16:22:54.284519 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0

    16:22:54.284545 --- SIGTSTP {si_signo=SIGTSTP, si_code=SI_TKILL, si_pid=109977, si_uid=1000} ---

    16:22:54.284559 --- stopped by SIGTSTP ---


Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/9586@github.com>

lacygoill

unread,
Jan 22, 2022, 5:09:05 PMJan 22
to vim/vim, Subscribed

Cc @dbivolaru via #9422


Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/9586/1019366592@github.com>

Dorian Bivolaru

unread,
Jan 23, 2022, 8:56:04 AMJan 23
to vim/vim, Subscribed

Found and fixed it. Thanks for taking the time to file this @vain.


Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/9586/1019490900@github.com>

Bram Moolenaar

unread,
Jan 23, 2022, 11:42:05 AMJan 23
to vim/vim, Subscribed

Closed #9586 via 79a6e25.


Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/9586/issue_event/5938446756@github.com>

vain

unread,
Jan 23, 2022, 12:06:45 PMJan 23
to vim/vim, Subscribed

@dbivolaru Yep, that fixes it. Thanks!


Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/9586/1019526564@github.com>

Reply all
Reply to author
Forward
0 new messages