-5

How shall I find out all the terminal types that can work?

On Lubunu 18.04, The followings work

$ TERM=xterm top
$ TERM=vt100 top

but the following don't:

$ TERM=lxterminal top
'lxterminal': unknown terminal type.
$ TERM= top
TERM environment variable not set.

The following returns nothing, which is said to give all the terminal types that can work

$ toe

In a docker container, the following works

$ sudo docker exec -t 851 top

$ sudo docker exec -t 851 env
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=851fbf59c6da
TERM=xterm
HOME=/root

but why do the following don't

$ sudo docker exec 851 top
TERM environment variable not set.

$ sudo docker exec 851 bash -c "TERM=xterm top"
top: failed tty get

$ sudo docker exec 851 env
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=851fbf59c6da
HOME=/root

Why doesn't prefixing a command with TERM=xterm work in a container while it does in Lubuntu?

Thanks.

  • You're missing the -t flag when you called sudo docker exec 851 bash -c "TERM=xterm top" – Stephen Harris Apr 7 at 1:18
  • I am not. That is for "Why doesn't prefixing a command with TERM=xterm work in a container while it does in Lubuntu?" – Tim Apr 7 at 1:24
  • Because you missed the -t after exec. So no terminal was associated with the exec. So top said "no terminal" – Stephen Harris Apr 7 at 1:25
1

The ncurses-bin package includes toe, which lists terminal descriptions.

As for which work, that's accomplished by reading the documentation for the terminal, which should tell you what it does.

  • toe returns nothing. How does it explain why some works, some don't? – Tim Apr 7 at 1:23
  • 1
    you gotta read the manual page, which answers this "toe returns nothing". That's not the documentation for your terminal. – Thomas Dickey Apr 7 at 1:28
  • Thanks. (1) How can I find out what is my terminal and what is the documenation for my terminal? (2) by reading the manpage, do you mean I should run toe -a? (3) man toe says "With no options, toe lists all available terminal types by primary name with descriptions", what does it mean by "all available terminal types by primary name with descriptions"? – Tim Apr 7 at 1:55
  • Actually none of the answers are very good, but this question gives some hints. There are other questions asking related things, but I don't see any that are useful. – Thomas Dickey Apr 7 at 10:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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