Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I connect to Android using "adb shell" and run certain commands such as "vim" or "mc", they are restricted to a "window" of 25x80 characters. Since I'm connecting from a desktop computer where xterm has a much higher resolution, I'd like to use it.

How do I resize this console window to e.g. 60x156 characters?

share|improve this question
add comment

2 Answers 2

up vote 13 down vote accepted

The answer is

stty rows 60 cols 156

A follow-up question is how do I determine the size of my xterm I'm connecting from so that I can pass it to stty automatically (using a script)?

share|improve this answer
    
Great that you found the solution to your own problem. Don't forget to "accept" it when you are able. However, don't include another question; this isn't a discussion forum. You should open a new question. If it's related you can link to this one from the new question. –  Al E. Oct 26 '11 at 20:40
1  
Is there a way to tell the android shell to resize automatically to fit the screen size? Similar to the way it's done on other terminals in Unix? –  shurane Apr 6 '13 at 20:19
    
i tried this, but it said "/system/bin/sh: stty: not found"... does it have to be installed or something? –  Brad Parks Sep 24 '13 at 13:44
    
Brad: Yes, it should be part of BusyBox. –  user46935 Sep 25 '13 at 8:48
    
For those who dont know BuxyBox: BusyBox is an app. that has a lot of common unix tools "inside" of it - it's particularly designed for embedded systems. To try it install BuxyBox app on your rooted android. –  JohnTortugo Oct 10 '13 at 18:19
add comment

If you're on a recent release of Android that uses mksh you can simply do:

COLUMNS=156
LINES=60
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.