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

Did you like this post or found it useful? Considering supporting this Blog to keep its web servers running, any amount helps! Thanks!
Have comments or feedback on what I wrote? Please share them below!
comments powered by Disqus
Other posts you may like...