gvim :sh backspace broken by patch 8.2.0260

5 views
Skip to first unread message

Gary Johnson

unread,
Oct 3, 2022, 2:35:31 PM10/3/22
to vim...@googlegroups.com
I seldom use gvim on Linux and even less often use :sh from gvim, so
I didn't notice this until recently when projects and my workflow
changed.

When :sh is used in gvim to launch a shell, the backspace and ^U no
longer work. Instead of backspacing or clearing the line, each just
puts gibberish in the line. I discovered that each was broken by
a different commit, so I'm reporting them separately.

Steps to reproduce

1. $ vim -g -N -u NONE -i NONE
2. :sh
3. Type a bunch of printing characters, it doesn't seem to matter
what. For example:

$ hello

4. Type the backspace key.
5. The 'o' is replaced by a 'b' and the cursor remains at the end
of the line.

Expected behavior

The cursor should move one space to the left, erasing the 'o'.

Version of Vim

9.0.651

Environment

Operating system: Ubuntu 20.04.5
Terminal: Not applicable, but gvim launched from an xterm
Value of $TERM:
In the original xterm: xterm-256color
In the :sh shell: dumb
Shell: bash
Desktop: xfce4
Behavior is the same in GNOME on Ubuntu 22.04.

Last output from 'git bisect':

$ git bisect bad
f4140488c72cad4dbf5449dba099cfa7de7bbb22 is the first bad commit
commit f4140488c72cad4dbf5449dba099cfa7de7bbb22
Author: Bram Moolenaar <Br...@vim.org>
Date: Sat Feb 15 23:06:45 2020 +0100

patch 8.2.0260: several lines of code are duplicated

Problem: Several lines of code are duplicated.
Solution: Move duplicated code to a function. (Yegappan Lakshmanan,
closes #5330)

src/option.c | 136 ++++++++++++++++++++++++-----------------------------
src/os_unix.c | 24 +---------
src/os_win32.c | 25 +---------
src/proto/term.pro | 1 +
src/quickfix.c | 24 +++-------
src/regexp.c | 22 +++++++++
src/regexp_bt.c | 12 +----
src/regexp_nfa.c | 12 +----
src/term.c | 31 ++++++++++++
src/version.c | 2 +
10 files changed, 128 insertions(+), 161 deletions(-)

Regards,
Gary

Bram Moolenaar

unread,
Oct 3, 2022, 3:22:55 PM10/3/22
to vim...@googlegroups.com, Gary Johnson

Gary Johnson wrote:

> I seldom use gvim on Linux and even less often use :sh from gvim, so
> I didn't notice this until recently when projects and my workflow
> changed.
>
> When :sh is used in gvim to launch a shell, the backspace and ^U no
> longer work. Instead of backspacing or clearing the line, each just
> puts gibberish in the line. I discovered that each was broken by
> a different commit, so I'm reporting them separately.
>
> Steps to reproduce
>
> 1. $ vim -g -N -u NONE -i NONE
> 2. :sh
> 3. Type a bunch of printing characters, it doesn't seem to matter
> what. For example:
>
> $ hello
>
> 4. Type the backspace key.
> 5. The 'o' is replaced by a 'b' and the cursor remains at the end
> of the line.
>
> Expected behavior
>
> The cursor should move one space to the left, erasing the 'o'.

I see the problem. The code was moved to a function, but the side
effect of changing "len" was dropped. I'll make a fix.

It is surprising it took so long for someone to notice.

--
XML is a nice language for computers. Not for humans.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages