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 ^U (Ctrl-U).
5. The line changes to something I can't reproduce here. It's
something like this:
$ hello |00| |00| u
|9B| |9B|
where the 'u' has an umlaut and each box occupies two spaces on
the one line. That line is immediately followed by these two
(so a newline must have been inserted, too):
Uhello\udc9b\udcfc: command not found
$ U
Hitting Enter at this point results in this:
U: command not found
Expected behavior
The 'hello' should be erased and the cursor moved to the start
of the now-empty line.
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 good
f4ae6b245a54f11dd967d06b80f30e5abf55fb82 is the first bad commit
commit f4ae6b245a54f11dd967d06b80f30e5abf55fb82
Author: Bram Moolenaar <
Br...@vim.org>
Date: Sat May 30 19:52:46 2020 +0200
patch 8.2.0851: can't distinguish <M-a> from accented "a" in the GUI
Problem: Can't distinguish <M-a> from accented "a" in the GUI.
Solution: Use another way to make mapping <C-bslash> work. (closes #6163)
src/getchar.c | 20 +++++++++++++++-----
src/gui.c | 4 ++--
src/gui_gtk_x11.c | 44 +++++++++-----------------------------------
src/version.c | 2 ++
4 files changed, 28 insertions(+), 42 deletions(-)
I should have mentioned this in my report of the backspace bug, but
at every 'git bisect' step, vim was build with these commands in an
environment that should not have affected the build (i.e., no
vim-affecting environment variables):
$ make distclean
$ make -j6
Regards,
Gary