I am trying to remap some of my keyboard shortcuts in bash. The problem is that when I try to display key code using Ctrl-V, not all keys work. For example, Typing Ctrl-V, then Home moves the terminal to the top, just as usual. Typing Ctrl-V, then Ctrl shows nothing. Typing Ctrl-V, then left arrow shows ^[OD, typing Ctrl-V, then Ctrl-left arrow shows the same thing. I am trying to remap Home and End to move cursor to the beginning or end of line, and Ctrl-arrows to jump words. I am in Solaris, using DtTerm.SOLUTION:.Xdefaults:Dtterm*DtTerm*Translations: #override \n\<KeyPress>osfBeginLine: string(0x1B)string([1~) \n\<KeyPress>osfEndLine:   string(0x1B)string([4~) \n\Ctrl<KeyPress>osfLeft:  string(0x1B)string(OC) \n\Ctrl<KeyPress>osfRight: string(0x1B)string(OD).inputrc:\e[1~: beginning-of-line\e[4~: end-of-line\eOD: forward-word\eOC: backward-word
Cursor keys in bash in dtterm don't work as expected
terminal;solaris;keyboard shortcuts
I've not used dtTerm in many years. You may be able to get it to work by setting both the keypad mode and cursor key mode to Application mode (found under Terminal -> Options).If that doesn't work then you will probably have to go down the Xresources route, but itstrikes me that the Home key (like the escape key) has a special meaning to DtTerm (ala OSF/Motif), and this needs extra work to get it to play nicely.Apparently using #override in Translations is not 'officially supported', but as a hack it works. You will need to find what keymapping are presently in place by running dtTerm from shell and then issuing a ShiftCtrl* to get dtTerm to dump it's keymap (which will appear on stdout on the shell that ran the dtTerm). * is the key on your numpad (sometimes known as KP_Multiply) when talking in terms of X Key bindings. I imagine the keymapping dtTerm will assign will be something like osfBeginLine.Next you need to get the actual key sequence you want to get (home key) by using something like xev. As an example my home key under my setup is keysym 0xff50.KeyPress event, serial 30, synthetic NO, window 0x3600001,    root 0x102, subw 0x0, time 643678606, (78,90), root:(1578,578),    state 0x0, keycode 110 (keysym 0xff50, Home), same_screen YES,    XLookupString gives 0 bytes:     XmbLookupString gives 0 bytes:     XFilterEvent returns: FalseNext you will need to edit your ~/.Xdefaults and add something like:Dtterm*DtTerm*translations:#override\n\:<KeyPress>osfBeginLine: string(0xff50)Then run dtaction ReloadResources, which should source your .Xdefaults file.With a bit of luck you should get the mapping, and then be able to do your key binding as usual. If not, you may have to muck about in the land of virtual binding of Motif, which I remember being a gigantic pile of spaghetti.References:dtTerm manual, dtTerm terminal options pageStandard Xresources dtTerm parses