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

Discussion in 'Jailbreaks and iOS Hacks' started by thelatinist, Jan 8, 2014.

  1. thelatinist macrumors 603

    thelatinist

    Joined:
    Aug 15, 2009
    Location:
    Connecticut, USA
    #1
    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."
     
  2. dasx macrumors 65816

    dasx

    Joined:
    Jun 18, 2012
    Location:
    Barcelona
    #2
    Thanks! Will come in handy when I decide to install MobileTerminal. I've been waiting for it to get "officially" updated to iOS7...
     
  3. thelatinist thread starter macrumors 603

    thelatinist

    Joined:
    Aug 15, 2009
    Location:
    Connecticut, USA
    #3
    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.
     
  4. vasili0s macrumors member

    Joined:
    Nov 19, 2012
    Location:
    Athens,Greece
    #4
    awesome, now i can finally run screen and irssi
     
  5. thelatinist thread starter macrumors 603

    thelatinist

    Joined:
    Aug 15, 2009
    Location:
    Connecticut, USA
    #5
    Glad it was helpful. There are a number of Unix tools which have this issue, and and it had been driving me nuts.
     
  6. dasx macrumors 65816

    dasx

    Joined:
    Jun 18, 2012
    Location:
    Barcelona
    #6
    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?
     
  7. Magnus.LPA macrumors newbie

    Joined:
    Jan 9, 2014
    #7
    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 :)
     
  8. thelatinist thread starter macrumors 603

    thelatinist

    Joined:
    Aug 15, 2009
    Location:
    Connecticut, USA
    #8
    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.

    ----------

    You're very welcome.
     
  9. dasx macrumors 65816

    dasx

    Joined:
    Jun 18, 2012
    Location:
    Barcelona
    #9
    Thanks man!
     
  10. thelatinist thread starter macrumors 603

    thelatinist

    Joined:
    Aug 15, 2009
    Location:
    Connecticut, USA
    #10
    Glad it helped. It was driving me nuts, too.
     

Share This Page