General FIX "Error opening terminal: xterm-256color" for Terminal Commands (e.g., "top") iOS7

thelatinist

macrumors 603
Original poster
Aug 15, 2009
5,934
49
Connecticut, USA
As many of you may know, the CLI tool "top" is a very useful tool that lists open processes in order of the resources they are using. The tool is available from Saurik's Cydia/Telesphoreo repo and has long been a staple in troubleshooting battery and memory issues on jail broken phones.

But if you've tried to run "top" in iOS 7, you have probably seen an error like this:

Code:
Error opening terminal: xterm-256color
After much frustration, I found a simple solution to this problem in reddit, and thought I'd put it here for anyone else who's got the same problem.

The issue is caused by the fact that iOS 7 has moved the terminal profiles. A simple symbolic link fixes the problem.

1. Login as root either through SSH or in MobileTerminal.

2. At the prompt, enter the following commands:
Code:
ln -s x /usr/share/terminfo/78
export TERM=xterm-color
The first command creates a symbolic link between /usr/share/terminfo/78, where "top" expects to find the xterm terminal profiles, and their actual location at /usr/share/terminfo/x. The second command changes your terminal setting from xterm-256color to xterm-color for better compatibility.

That's it. You can now run "top."
 

dasx

macrumors 65816
Jun 18, 2012
1,098
17
Barcelona
Thanks! Will come in handy when I decide to install MobileTerminal. I've been waiting for it to get "officially" updated to iOS7...
 

thelatinist

macrumors 603
Original poster
Aug 15, 2009
5,934
49
Connecticut, USA
Thanks! Will come in handy when I decide to install MobileTerminal. I've been waiting for it to get "officially" updated to iOS7...
Why? It works fine on iOS 7. It's not a very active project, and in my experience they are unlikely to release an update unless something is broken.
 

dasx

macrumors 65816
Jun 18, 2012
1,098
17
Barcelona
Why? It works fine on iOS 7. It's not a very active project, and in my experience they are unlikely to release an update unless something is broken.
I don't know... I backed off because it says through Compatible with iOS 3.2+ to 6.
Where do I get top btw?

EDIT: If it was fully compatible I guess they would've added iOS7, wouldn't they?
 

Magnus.LPA

macrumors newbie
Jan 9, 2014
1
0
Thank you.

I created an account just to thank you man.

Thanks for finding this solution and more importantly, thanks for sharing it! :D That was driving me nuuuuuuuts!

Great job :)
 

thelatinist

macrumors 603
Original poster
Aug 15, 2009
5,934
49
Connecticut, USA
I don't know... I backed off because it says through Compatible with iOS 3.2+ to 6.
Where do I get top btw?

EDIT: If it was fully compatible I guess they would've added iOS7, wouldn't they?
As I said, it's not a particularly active project. The same version has been working for years, and only one point version update has been made in the past three years. I wouldn't expect them to update the package unless there is something broken. And BigBoss probably won't do it on his own, either.

Don't get me wrong: you're welcome to wait if it makes you more comfortable. But don't be surprised if iOS 8 comes out and they still haven't updated that message.

And "top" is in the default repo (Cydia/Telesphoreo). You can just search. If it doesn't show up, then I imagine you have selected "User" instead of "Hacker" (or "Developer") in Cydia's settings. That setting hides command line tools. You can change it under Manage > Settings in Cydia.

----------

I created an account just to thank you man.

Thanks for finding this solution and more importantly, thanks for sharing it! :D That was driving me nuuuuuuuts!

Great job :)
You're very welcome.
 

dasx

macrumors 65816
Jun 18, 2012
1,098
17
Barcelona
As I said, it's not a particularly active project. The same version has been working for years, and only one point version update has been made in the past three years. I wouldn't expect them to update the package unless there is something broken. And BigBoss probably won't do it on his own, either.

Don't get me wrong: you're welcome to wait if it makes you more comfortable. But don't be surprised if iOS 8 comes out and they still haven't updated that message.

And "top" is in the default repo (Cydia/Telesphoreo). You can just search. If it doesn't show up, then I imagine you have selected "User" instead of "Hacker" (or "Developer") in Cydia's settings. That setting hides command line tools. You can change it under Manage > Settings in Cydia.
Thanks man!
 

Similar threads

Register on MacRumors! This sidebar will go away, and you'll see fewer ads.