problem with HOME, END, DELETE, BACKSPACE and TAB keys

Hello.

Is there a general fix to make these keys function naturally?
HOME - go to the start of the current line.
END - go to the end of the current line.
DELETE - remove a character after the cursor.
BACKSPACE - remove a character before the cursor.
TAB - insert a tab character in editor, (try to) autocomplete in shell.

Some of the problems I'm facing:
Home and End keys insert the tilde character (~) in shell and triggers the menu in ee.
Tab inserts tab character in shell.
Backspace also inserts a character inside VIM and LESS.

Thanks in advance.
 
I think [thread=13950]correcting termcap[/thread] is the way to go.
 
set the correct TERM variable. If you use PuTTY set TERM to xterm.
 
PuTTY vs xterm for $TERM

PuTTY's behavior doesn't match xterm.
ncurses has a "putty" terminal description,
which does match the default settings for PuTTY.
 
itcotbtoemik said:
PuTTY's behavior doesn't match xterm.
Set Home and End keys to rxvt. Everything else can stay default. Works like a charm.
 
PuTTY vs xterm and rxvt

Actually, all three (PuTTY, xterm and rxvt) have different key bindings.
PuTTY happens to be closer to xterm by default; I see that it has a
selection for home/end keys marked "rxvt", but haven't verified if it
is correct.
 
This work for me

PuTTY configuration

Set terminal-type string to xterm.

putty00.jpg


putty01.jpg

tcsh key bindings

Code:
## Del
# Delete key (see FreeBSD FAQ on keyboard and mouse)
bindkey "\e[3~"   delete-char              # xterm

## Home & End
# Home and End keys for XTerm compatible console
bindkey "\e[1~"   beginning-of-line        # xterm
bindkey "\e[4~"   end-of-line              # xterm

In GNU screen (with $TERM set to xterm) the End key in midnight commander does not work (do nothing), it binds to ESC[4~ but does not work.

See also these links:
FreeBSD FAQ - Keyboards and Mice
Consistent BackSpace and Delete Configuration
 
Making applications recognize your function keys (Delete, HOME, END, etc) is one of the purposes for termcap/terminfo databases. If you need to bind a key (e.g. Home, \e[1~) only in one terminal emulator while others work fine then you're doing it wrong and you'd end up having to make same keybind in every application under such terminal emulator.
 
Back
Top