Bug 6223 - Can't backspace in vim in console mode
Can't backspace in vim in console mode
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: vim (Show other bugs)
6.0
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Michael K. Johnson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-10-22 00:34 EDT by Stephen Rasku
Modified: 2008-05-01 11:37 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-02-15 12:24:19 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Stephen Rasku 1999-10-22 00:34:35 EDT
I can't backspace in vim in console mode (i.e. non-X mode).
When I type backspace I get ^? displayed.  This problem
occurs for both vim-enhanced-5.3-7 and vim-enhanced-5.4.2.
Interestingly, I don't have this problem inside KDE either
running vim or gvim.
Comment 1 erik 1999-10-25 19:59:59 EDT
I think this is because:

The termcap and terminfo databases disagree on how to delete to the
left on the linux console.  Termcap says

# *
WARNING:                                      *
# * Some Linuxes come with a default keyboard mapping that makes
kbs=^? and *
# * all have kcbt=^I.  Apply `loadkeys -d' to change this if
necessary, and *
# * bug your Linux distributor to get it right in the next release.
Here   *
# * are the keymap replacement lines that will fix the
problem:             *
#
*
*
#       keycode  14 = BackSpace       BackSpace
#               alt     keycode  14 = Meta_BackSpace
#       keycode  15 = Tab             Tab
#               alt     keycode  15 = Meta_Tab
#               shift   keycode  15 = F26
#       string F26 ="\033[Z"

and kb=^H and kD=\E[3~  This is termcap-9.12.6-15

terminfo has kbs=\177 and kdch1=\E[3~

I have a patch that fixes the console keymaps to give BackSpace (^H)
with the unshifted backspace key and Delete (^?) with the Control key
for all languages.  No need to change Russian, they were already set
up that way.  This would match the termcap entry.

Alternatively, the termcap entry could be changed to match the
terminfo entry (^?).  The disadvantage of this is that xterm has a
strong tendency to produce ^? for the Delete keysym (bottom left on
the six-key block above the cursor keys).  You would want that (^?) to
delete the letter under the cursor in readline apps like bash.  You
can achieve that by adding
DEL: delete-char
to /etc/inputrc, but then things will go wrong in the console.
Therefore I favour fixing things so ^H is used on the console.  This
has the added advantage that on the console the backspace and delete
keys are mapped in such a way that XFree automatically gives them the
correct BackSpace and Delete keysyms when it reads the console
keyboard and sets up the default keymap.  That way Motif apps just
work.

I have a fix to mingetty to get it to issue the required stty so
things work on the console.

The present situation with backspace and delete is not very
satisfactory.  On a standard install, under the console and xterm,
none of the readline apps, including bash, are capable of deleting the
character under the cursor when the user presses the Delete key.  They
either don't work, or delete in the wrong direction.

This is related to bug 6358
Comment 2 Preston Brown 2000-02-15 12:24:59 EST
fixed for 6.2 and later.
Comment 3 Stephen Rasku 2000-04-27 02:56:59 EDT
What RPM(s) do I need to install to fix this bug for RH 6.0?

Note You need to log in before you can comment on or make changes to this bug.