Hard-to-find tips on otherwise easy-to-do tasks involving everyday technology, with some advanced insight on history and culture thrown in. Brought to you by a master dabbler. T-S T-S's mission is to boost your competitiveness with every visit. This blog is committed to the elimination of the rat from the tree of evolution and the crust of the earth.
Sunday, July 01, 2018
No One Tells You What to Do.... Until Now..
Root cause - using csh - which the dinosaurs *also* deprecated in favour of bash..
So, what's a man to do?
Easy - use the "bindkey" command (csh and tcsh only)
Example, you want ALT-F to do something... instead, it prints a weird character.
So, do :
$ bindkey <now-press-ALT-F-to-get-the-weird-character> forward-word
And you're done..
Same for things like Delete key, etc..
Not helpful enough :
https://www.linuxquestions.org/questions/linux-general-1/insert-and-delete-key-returns-~-in-a-terminal-876401/
https://unix.stackexchange.com/questions/81256/tilde-when-clicking-del-key
Okay, what I've told you so far, gets you to a point - you'll find that, in an xterm session, you can do this and it'll work, but, when you try putting that in a .cshrc, you'll be in for a surprise..
bad key spec
territory :( And stackoverflow ain't much help. That's why you come here..
And the answer? Look up that funny character in the ASCII table - for example, if it's the small a with a hat on top, take that code, get the octal representation (just go to a new tab and type 226 to octal and let google do the work :)
Then, in your .cshrc
bindkey "\342" forward-word
And you're through. You're welcome!
Labels:
bash,
bindkeys,
csh,
keyboard shortcuts,
shell
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment