The following Ex command causes vim to hang and it's not possible to recover with CTRL-C:
:e `yes`
Same issue with:
:echo expand("`yes`")
In contrast, it is possible to interrupt with CTRL-C when doing e.g.:
:!yes
or:
:echo system('yes')
Expected behavior
It should be possible to interrupt an endless command with CTRL-C.
Environment
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
The following Ex command causes vim to hang and it's not possible to recover with CTRL-C:
:e `yes`
/usr/bin/vim that comes with Ubuntu-18.04.05 i.e. vim-8.1.1453 does not have the bug.
So it's a regression. Doing a git bisection, I found that:
So bug was introduced in this patch: 26e8644 :
commit 26e86445bf06ab7e7587dfdf75f33f7c70632b46
Author: Bram Moolenaar <Br...@vim.org>
Date: Sun May 17 14:06:16 2020 +0200
patch 8.2.0774: t_TI and t_TE are output when using 'visualbell'
Problem: t_TI and t_TE are output when using 'visualbell'. (Dominique
Pelle)
Solution: Do not change the terminal mode for a short sleep. Do not output
t_TI and t_TE when switching to/from TMODE_SLEEP. Make tmode an
enum.
—
With the fix in vim-8.2.1513, I can now interrupt commands like...
:e `yes`
:echo expand("`yes`")`
Good. However, I now see spurious characters. For example, if I run :!date, I get:
�[>4;mMon Aug 24 15:03:49 CEST 2020
�[>4;2m
Press ENTER or type command to continue
Whereas prior to vim-8.2.1513, I would get the expected:
Mon Aug 24 15:03:49 CEST 2020
Press ENTER or type command to continue
This is with xfce4-terminal-0.8.7.4 that comes with Ubuntu-18.04.5.
Same issue at least with gnome-terminal 3.28.2 that comes with Ubuntu-18.04.5.
That is a bug in the terminal, the t_TE and t_TI codes should be ignored if not recognized.
You might find a more recent terminal version that has fixed this.
Or you can make t_TE and t_TI empty.
It's not nice, but not being able to interrupt the shell is worse.
For me it continued until /tmp was full before it gave up producing "y".