When I open a terminal, I see a continuous stream of tilde symbols appearing although I'm not pressing the key.

gaurav122197@gaurav122197:~$~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~‌​~~~~~~~~~~~~~~~~~~~~‌ ​~~~~~~~~~~~~~~~~~ 

(re‌​peatedly until I close the shell)

5

4 Answers

You said that some windows get automatically scrolled down. Your "Page Down" key (which scrolls down windows) might be stuck in, because pressing Page Down creates tildes on the terminal windows for some reason. Try unplugging the bad keyboard from your computer and using a different one.

If your internal/main keyboard continuously types the ~ key, then you've got a stuck key, or a bad keyboard. Seriously, turn the keyboard upside down and shake it to release all of the cookie crumbs and see if that helps.

Hooking up an external keyboard won't disprove this answer. You must disconnect the internal/main keyboard to prove it. While it is unplugged, use an external keyboard.

The most probable reason for this is a faulty keyboard!

PGDN and function keys F5, F6, F7 and F8 create a tilde ~ sign on the terminal. So if any one of these keys on a keyboard is faulty, one will see such behaviour as you mentioned.

We can disable these keys and fix this problem. The procedure is given below:

  1. Find the keycode of the faulty key. This can be done by the following command:

    xmodmap -pke 
  2. Disable the key using;

    xmodmap -e 'keycode of the faulty key' 

    For example, F8 has keycode 74, therefore xmodmap -e 'keycode 74=' will disable F8.

You may create a bash script to run the command during startup. Then you will not have to run it repeatedly.

Same thing happened when using PuTTY, but my solution was to change the way a keep-alive app called Caffeine generated it's keep-alive. It was generating F13.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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