Bug 218632

Summary: Can't backspace when in vi command mode when the backspace key is set to ^?
Product: Red Hat Enterprise Linux 4 Reporter: Ron <infotbs>
Component: pdkshAssignee: Karsten Hopp <karsten>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4.4   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-12-07 12:21:55 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
A two line patch for pdksh-5.2.14-30.3 none

Description Ron 2006-12-06 16:12:56 UTC
Description of problem:
The default erase key for Linux is set to ^? (xterm).  Therefore when using the
vi editing mode, when in command mode it would advantageous to be able to
backspace using ^? (this is in addition to the h and ^H keys) as it is for the
editing mode.  For example this is how it is on SCO OpenServer’s ksh (I thinks
it’s version is @(#)Version 11/16/88g).

Version-Release number of selected component (if applicable):
@(#)PD KSH v5.2.14 99/07/13.2

How reproducible:
Always reproducible.

Steps to Reproduce:
1. Check that your erase key is set to ^? using stty.
2. EDITOR=vi; export EDITOR  #To use vi editing mode.
3. Now enter the input line editing command mode and try to backspace, you
should see that it does not.
  
Actual results:
Does not backspace.

Expected results:
Should backspace.

Additional info:
I have also submitted this to pdksh.ca which according to
http://www.cs.mun.ca/~michael/pdksh/ is the place to log bugs, but I think it
may be preferable to RedHat to include this on its own.

Comment 1 Ron 2006-12-06 16:12:56 UTC
Created attachment 142961 [details]
A two line patch for pdksh-5.2.14-30.3

Comment 2 Karsten Hopp 2006-12-06 16:33:34 UTC
do you have vim-common installed ?  (rpm -q vim-common)

Comment 3 Ron 2006-12-06 16:44:41 UTC
Yes, vim-common-6.3.046-0.40E.7.  Please correct me if I'm wrong but I don't see
how this would have any effect since pdksh doesn't use an external vi or vim, it
instead uses it's own implementation of vi for command line editing (see vi.c).

Comment 4 Karsten Hopp 2006-12-07 12:21:55 UTC
I've misread your report and thought you had problems which editing files with vi.
vi-mode is exactly behaving as described in the manual page. 
kill, erase werase, eof, intr and quit work only in insert mode, in edit mode
you'll have to use x for delete and X for erase (backspace).
I'll add this feature when it has been accepted upstream, though.

Comment 5 Ron 2007-04-17 16:07:58 UTC
Just a small note, in the original report I mentioned that I couldn't backspace
using the erase key as defined by stty; here backspace meant to move the cursor
from right to left without any character changes.
Therefore I think you meant in comment #4 that I'll need to use h or ^H to move
the cursor to the left.

Thanks, Ron.