top 'xterm': unknown terminal type.
Hello mates,
I have an error when run TOP command: >top 'xterm': unknown terminal type. > echo $TERM xterm > echo $DISPLAY DYSPLAY: Undefined variable. > cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.3 (Santiago) > ls /usr/share/terminfo/ 1 2 3 4 5 6 7 8 9 a A b c d e E f g h i j k l L m M n N o p P q Q r s t u v w x X z > ls /usr/share/terminfo/x/xterm /usr/share/terminfo/x/xterm i have that problem also with Root. do TOP use xterm? How can i do? |
Command line applications rely on your TERM variable to determine how to display information your screen. Since top has to show information on you screen (in a text) interface it needs to use the TERM you defined.
xterm is the default for many things and is based on the old vt100 definition. On my RHEL6.x boxes top runs fine using xterm. This suggests perhaps there is an issue with the xterm you have or the top you have. Run "rpm -qf /usr/share/terminfo/x/xterm" to determine which package installed that. Run "yum list <package>" on the name of the package without version, architecture to see if there are newer versions available. e.g. if the first command output something like: ncurses-base-5.7-3.20090208.el6.x86_64 then run "yum list "ncurses-base". That should show which version you have installed and if any later versions are available. If there are later versions you can update by running "yum update <package>" to see if it gives you a better xterm. Similarly you could check the same for top. By the way when doing "ls" you might want to get in the habit of doing "ls -l" instead as it gives you much more information about the file. (e.g. if it a link when it shouldn't be). |
Seeing that this is a RHEL system and the DISPLAY variable is not set I assume that this system is not running a GUI. Since Xterm is a GUI program it is not really a surprise that top can't handle it when no GUI is running. Set your TERM variable to linux and try it again.
|
Quote:
You're confusing the X application named "xterm" with the Terminal definition of the same name. One does NOT need to be running X nor have the DISPLAY variable set to use the "TERM" variable "xterm" which is specifying the terminal definition rather than the X application. For example all of my PuTTY sessions use "xterm" by default. The "xterm" terminal definition is just a modified version of the old vt100 definition optimized to run INSIDE the xterm X application but other applications are quite happy using that xterm definition as well. |
Quote:
|
One possibility is that xterm (or the other GUI terminal emulations) is not installed.
Second,Red Hat Enterprise Linux Server release 6.3 (Santiago) may not even have a GUI installed (which can also require the XTERM terminal definitions to be installed). Third - if no GUI is installed, then the terminal connection must be using the basic one. Which happens to be name "linux" for the console. This is NOT an xterm. This also means that the user has the TERM environment variable defined in their profile/.login/.bashrc/... somewhere. This should never be done. As a point, xterm is an extended ANSI terminal escape specification - it isn't VT100. A VT100 did have a number of escape sequences in common with an ANSI terminal - but only about half. The other half did things like setting scrolling regions, double width and/or double height characters, blinking (I think), and inverse video... As I recall, ANSI did not have color capability - xterm does. Top uses the ncurses library which uses the terminfo database for terminal information (or termcap if so configured at compile time). This is a portable and reconfigurable set, but it requires the database to contain the definitions. Since the error is "'xterm': unknown terminal type." that means the definition of an xterm is not in the database. Removing the definition of the environment variable TERM from the profile will allow the system to use the name it has been configured to use (most likely the value is supposed to be "linux"). |
Quote:
|
Quote:
A TERM environment variable set to "xterm" will not work properly from the console. Not all escape sequences are recognized by the VT console for instance. |
The OP posted originally that he DOES have the xterm terminfo file as shown by his ls output.
It is NOT correct to say it ONLY works with "GUI" tools such as Xterm. It is also NOT correct to say it only installs with GUI/X. It is part of the ncurses package that installs multiple terminfo files. As I noted in a prior post it works in PuTTY and various other terminal emulators as well. Specifically top DOES work with xterm in PuTTY even though neither top NOR PuTTY are X applications. It IS correct to say that different terminfo files have different capabilities however his issue wasn't one of capability but rather that it was telling him it didn't recognize his TERM at all (i.e. couldn't find it not that it didn't work properly). My initial response to him was talking about additional information he needs to look at because as noted above it DOES work on my systems. |
Quote:
'xterm': unknown terminal type. Thus it is not known. Quote:
The fact that the error says "unknown terminal type" says it isn't installed. Quote:
Quote:
|
Quote:
The answer is NOT just a "simple" it isn't there. The OP posted that it is there as shown by ls so my original response was trying to get more information. Since you'll now post more meaningless drivel I'll let you have the last word. |
All times are GMT -5. The time now is 12:15 PM. |