You are not logged in.
Pages: 1
Hello everyone,
I was having some troubles with that variable environment, for example, I got "unknown terminal type linux" by nano when I was in a TTY. I took care of it exporting variable TERM with xterm in my .bashrc.
Now I can use nano in a TTY again. I think it was not enough though, indeed I still get
"shell clear'XTERM': unknown terminal type."
when debugging with gdb.
Is just exporting the TERM variable environment enough to get it work or anything else is needed?
Thanks for reading.
Last edited by Grant (2013-11-15 16:51:58)
Offline
Do you mean tty as in 'outside of X'?Have you tried lowercase 'xterm'?
Last edited by karol (2013-11-15 16:54:31)
Offline
By gdb = inside X
By nano = outside X
However, lowercase xterm doesn't work.
Offline
This is my .bashrc:
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
#begin ALIAS
alias ls='ls --color=auto'
alias reb='systemctl reboot'
alias off='systemctl poweroff'
alias sus='systemctl suspend'
#end ALIAS
PS1='\[\e[01;36m\]\u@\[\e[1;36m\]\h \W\$\[\e[m\] '
#begin export
export TERM=xterm
#end export
Offline
xterm ix an X terminal emulator, it doesn't work outside of X, neither will setting term type to xterm make your tty happy.
Offline
I don't think you need to be manually setting $TERM at all. You should remove that and let the system figure out what it needs at any given point. The TTY/console uses TERM=linux, and setting that variable to an Xorg dependent terminal emulator is sure to cause you issues.
The one exception where setting $TERM manually might be necessary is if you are remotely logging into a machine. When I ssh into my home headless file server, it doesn't like that my $TERM variable is set to xterm-termite, so I have to fix this in my zshrc.
Offline
Then which could be the solution?
I would like to know why I get that problem, maybe what has changed, because before I have never come across it.
Offline
Here is what I use, in ~/.bashrc:
if [[ -n $SSH_CONNECTION ]] ; then
export TERM=linux
elif [[ $COLORTERM == xfce4-terminal ]] ; then
# http://vim.wikia.com/wiki/256_colors_in_vim
export TERM=gnome-256color
# http://pkgs.fedoraproject.org/cgit/coreutils.git/tree/
eval `dircolors --sh "/etc/DIR_COLORS.256color"`
else
export TERM=linux
eval `dircolors`
fi
Offline
$TERM sets the 'terminfo' file that the console or the terminal emulator will use to translate keystrokes and escape sequences into glyphs and actions. By setting TERM=xterm you'll confuse your terminal programs.
Do you still have the problem if you start nano with this command?
$ TERM=linux nano <somefile>
Offline
$TERM sets the 'terminfo' file that the console or the terminal emulator will use to translate keystrokes and escape sequences into glyphs and actions. By setting TERM=xterm you'll confuse your terminal programs.
Do you still have the problem if you start nano with this command?
$ TERM=linux nano <somefile>
Yes, I do both inside and outside X.
Offline
With respect to all those above, I have to disagree with most of these suggestions. Perhaps with the exception of cases like ssh sessions, TERM variables should never be set manually (unless as a one-off diagnostic test).
In a tty TERM should be "linux". Nano works fine with this. If it doesn't on your end, you should not try to cover the problem with metaphorical duct tape, but instead figure out what the real problem is and fix it.
Some relevant diagnostics:
pacman -Qs ncurses
ls /usr/share/terminfo/l
Last edited by Trilby (2013-11-16 14:21:26)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Pages: 1