0

I want to remap my F9 key to the dollar sign ($) symbol.

So I ran this command

bind '"\e[20": "$"'

Now whenever I type the F9 key, instead of getting just

$

I get

$~

Why is the extra tilde there and how can I get rid of it?

1
  • F9 is \e[20~ for me. That's probably where the ~ comes from. Press Ctrl-V and then F9. What do you get? – muru Dec 15 '16 at 9:00
1

Try this:

bind '"\e[20~": "$"'

To determine character sequence for a key press,

  • Press Ctrl+v and press the key for which you want to get the character sequence.

Example:

For key F9, I get ^[[20~ where ^[ is Esc key and remaining sequence is for F9.

1
  • Thanks! That did the trick. For me Ctrl+v does not work but I was able to get the keycode using the method described here – Guillaume Perrault-Archambault Dec 15 '16 at 23:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.