None of those keys are tilde keys. They all generate a multiple character sequence, such as ESC [24~
for the F12 key, or ESC [15~
for the F5 key (although F1–F4 are slightly different), or even ESC [5~
for the PgUp key.
The only reason you get a tilde is because Bash's key-sequence parser consumes the common part that it knows (ESC [2
) and stops as soon as it knows that the full sequence will be unknown. Everything that follows (not neccessarily a tilde!) gets interpreted separately.
Note that this behavior may differ between terminal-based programs: Bash (readline) has its own code for interpreting special keys, Vim has its own, Irssi has its own again. Some programs might fully recognize your keypress as F10 (and therefore ignore it).
To make F10 an actual tilde key globally (OS-wide), search for "key remapper" tools (perhaps AutoHotkey).
To make F10 a tilde key in all terminal-based programs, search through the terminal's settings. (The 'terminal' in this case refers to ConEmu.)
The terminal might have its own functionality for redefining single keys, or perhaps creating "macros". (The ConEmu documentation suggests defining a macro with the print(…)
action.)
To make F10 a tilde key in Bash (but only Bash):
Make sure that your terminal emulator (ConEmu) hasn't bound F10 to some function of its own. (Plain F10 is usually not bound to anything – however, Shift+F10 is the standard key for opening the "right-click" menu.)
In bash, press CtrlV (literal insert) and then F10. You will see a sequence like ^[[21~
.
(The initial ^[
represents ESC, while the rest are just literal symbols.)
If, at this point, the key doesn't insert any sequence at all, that means it has been taken over by the terminal itself or another program – go back to step 1.
Open (or create) the ~/.inputrc
file in a text editor.
Add this line, taking the sequence from step #2 and replacing ^[
with \e
:
"\e[21~": "~"
This tells inputrc to insert a ~
upon receiving ESC [21~
.
Reopen the Bash shell (or press CtrlX, CtrlR to reload inputrc).