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
ikromin@:~ >
^[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!
Read full article from Mouse wheel displaying control characters in a terminal or scrolling through history instead | Igor Kromin
No comments:
Post a Comment