Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

I've recently had an odd experience when using Bash. When I used the mouse wheel to scroll up/down the Terminal window (in OSX) all I got was some control characters being printed out. It looked similar to this...
 Terminal
^[OA^[OA^[OA^[OA^[OA^[OA^[OA^[OB^[OB^[OB^[OB^[OB^[OB^[OA^[OA^[OA^[OA


At the time I was sudo'ed as another user so I exited that shell and tried the mouse wheel again only to have it scroll through the Bash command history instead.

After a bit of reading around this turns out to be related to something called 'cursor addressing' mode that programs like vi and less use. Usually this is turned off after you exit the program, unless something going wrong. There is a way to turn it back off by doing this:
 Terminal
tput rmcup


After running the above command I was able to scroll with the the mouse wheel again!



This most likely happened to me due to a VPN disconnection while being logged in on the remote server and having less open. No matter the cause the above fixes it.

-i

Skip down to comments...
Hope you found this post useful...

...so please read on! I love writing articles that provide beneficial information, tips and examples to my readers. All information on my blog is provided free of charge and I encourage you to share it as you wish. There is a small favour I ask in return however - engage in comments below, provide feedback, and if you see mistakes let me know.

If you want to show additional support and help me pay for web hosting and domain name registration, donations, no matter how small, are always welcome!

Use of any information contained in this blog post/article is subject to this disclaimer.
 
comments powered by Disqus
Other posts you may like...