11

I use tcsh , and when Delete/End is pressed on cmd line, it simply shows up as ~ ; I have to press <Ctrl><e> to go to end of line. Can anyone help me to be able to use Delete/End keys as their name suggests ?

TCSGrad
  • 11,898
  • 14
  • 49
  • 70

3 Answers3

16

Those keys already worked on my Debian system. I found these commands in the /etc/csh.cshrc file:

if ($?tcsh && $?prompt) then
        bindkey "\e[1~" beginning-of-line # Home
        bindkey "\e[7~" beginning-of-line # Home rxvt
        bindkey "\e[2~" overwrite-mode    # Ins
        bindkey "\e[3~" delete-char       # Delete
        bindkey "\e[4~" end-of-line       # End
        bindkey "\e[8~" end-of-line       # End rxvt
endif
Teddy
  • 6,013
  • 3
  • 26
  • 38
  • 3
    I found that instead of memorizing the cryptic \e[ sequence , you can directly type: `bindkey delete-char` - that way you don't need to hunt for the sequence !! :) Anyway , your's was the most comprehensive answer !! – TCSGrad Dec 16 '09 at 06:16
1

You need to use the bindkey builtin. See the tcsh man page discussion for details (search for 'bindkey'), but you want to add a line like

bindkey [end] end-of-line

to your .cshrc or .tcshrc file, replacing '[end]' with the actual end keypress. See this page for the list of binding names and helpful examples.

ire_and_curses
  • 68,372
  • 23
  • 116
  • 141
  • Correct , but when typing in the above line (I'm using vim), u have to replace [end] with `` !! – TCSGrad Dec 16 '09 at 06:13
0

There's a great resource on fixing inconsistencies with delete/backspace here. The document also addresses mapping home/end, though that's not the focus.

mrkj
  • 3,041
  • 19
  • 24
  • Yes , I got that doc from google , but it was too generalized (not to add huge !!) ... I guess u r more patient than I am !! :) – TCSGrad Dec 16 '09 at 06:17