Reputation: 413
Sometimes when I am using less
within a screen
tab, the arrow keys display ^[OA
, ^[OB
, ^[OC
, and ^[OD
instead of doing what I want them to do. Is there something I can do to fix this and gain control of less
again?
Upvotes: 10
Views: 4685
Reputation: 168948
I have found that reset
from within screen does not solve the problem sometimes, as it's the outer client/shell whose state is actually confused and screen captures the control characters from reset
and prevents them from reaching the outer client. In this situation, I have to detach my session (Ctrl+a, d), run reset
, then attach to the session again (screen -r
).
Upvotes: 5
Reputation: 2030
Another thing to check is your TERM variable. In my case I ssh into a Linux box and run less inside screen - the TERM variable was set to 'screen' - which breaks arrow keys. It works perfectly if I run less this way:
TERM=xterm less <file>
Upvotes: 2
Reputation: 10639
cat
or less
a binary file) shatters your console by sending it control characters. You need to run reset
command from command line to recover.Upvotes: 2