Bug 161315

Summary: Emacs exhibits different delete key behaviour between linux tty and xterm
Product: [Fedora] Fedora Reporter: David Howells <dhowells>
Component: emacsAssignee: Jens Petersen <petersen>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4   
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-09-30 02:12:57 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:

Description David Howells 2005-06-22 11:20:59 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (compatible; Konqueror/3.4; Linux) KHTML/3.4.0 (like Gecko)

Description of problem:
emacs -nw when run on the linux text tty shows the following key bindings:    
    
    CTRL-d    - C-d; delete-char    
    CTRL-h    - C-h; goes into help menu    
    Backspace - DEL; backward-delete-char-untabify    
    DEL       - <deletechar>; delete-char    
    
emacs -nw when run under the "xterm" program shows the following key bindings:    
    
    CTRL-d    - C-d; delete-char    
    CTRL-h    - DEL; backward-delete-char-untabify    
    Backspace - C-d; delete-char    
    DEL       - <deletechar>; delete-char    
    
I've checked with strace, and in both cases the same data is read by emacs for    
each type of keypress: 0x04; 0x08; 0x7f; and 0x1b 0x5b 0x33 0x7e.    
    
I've tried changing the TERM, DISPLAY and LANG variables, but to no effect. 
infocmp doesn't show any obvious differences between the xterm and linux 
terminal types, so I don't know what's determining the behaviour. 

Version-Release number of selected component (if applicable):
emacs-21.4-5

How reproducible:
Always

Steps to Reproduce:
1. Run emacs -nw on linux tty. 
2. Type a character and press the backspace key. 
3. Repeat on emacs -nw running on an xterm. 
   

Actual Results:  On the linux tty the character entered is deleted, but on the xterm emacs 
complains about the cursor being at the end of the buffer. 

Expected Results:  In both cases the character should be deleted. 

Additional info:

The reason I'm raising this bug is that firstly the delete behaviour ought to 
be consistent; secondly, the backspace key usually deletes backwards and in 
the xterm case it doesn't; and thirdly this might affect programs other than 
emacs.

Comment 1 Jens Petersen 2005-06-23 00:48:19 UTC
I have a feeling this is likely an upstream faq.

Could you please try to ask about this upstream, eg
on emacs-devel list or gnu.emacs.help?

This is somewhat akin to the debates on C-h vs Backspace for emacs
on the terminal, I think.

Anyway assuming it is not a Fedora specific problem, then
the change needs to be made upstream first.

Does the same thing happen with cvs emacs?