Recently while working in Putty logged into my Fedora system I have started getting random ~ characters on my shell. Additionally, while I am editing in VIM I'll have characters randomly change to upper case. This only happens while I am logged int using Putty. I've never had this happen before so I am wondering if an update to Fedora has turned on some sort of keep alive feature in SSH that is causing this. I re-installed putty and trashed my preferences just to be sure. I'm not sure where to start digging to find the culprit. Any pointers?
It looks like you're typing a function key that sends an escape sequence that isn't recognized on the remote side. Many function keys generate escape sequences that end with the
~ character, e.g.
\e[3~ for the Del key (where
\e is the escape character). See How do keyboard input and text output work? (the part about input in the section about text mode applications running in a terminal) for more information about function keys in terminals.
If your shell and vim on the remote side don't recognize this escape sequence, they'll eat up
\e[ (prefix of a recognized sequence), beep on
3, and treat
~ as an ordinary character.
At the shell prompt or in Vim insert mode, press Ctrl+V then the function key in question to see what it inserts. You may then want to create a binding for it: for bash, with the
bind builtin in
~/.bashrc (example) or in
~/.inputrc (example); in vim, with
map! <ESC>[3~ <Delete>
(Note that this example is preconfigured, you need to find out which key is not recognized on your system and adjust the escape sequence and key name accordingly.)