It's strange that neither
ssh user@192.168.1.59 bash -c "top"
nor
ssh user@192.168.1.59 "top"
works as expected, whereas both
ssh user@192.168.1.59 "ls"
and
ssh user@192.168.1.59 bash -c "ls"
work well.
Here is the error message\output for the former command.
TERM environment variable not set.
I searched and found this post.
As per the said post, there is an answer
shed some light on this matter.
You can see if it's really not set. Run the command set | grep TERM. If not, you can set it like that: export TERM=xterm
I tried
ssh user@192.168.1.59 bash -c "set | grep TERM;top"
, and the output is
TERM=dumb
TERM environment variable not set.
, which is in my expectation.
Then I try to set XTERM
as what the post told me, but it does not work. I am stuck again.
Here is my command to set XTERM
and run top
:
ssh user@192.168.1.59 bash -c "export TERM=xterm-256color; top"
Here is the output for the above command:
declare -x DISPLAY="localhost:13.0"
declare -x LANG="en_US.UTF-8"
declare -x LC_ALL="C"
#...
TERM environment variable not set.
Could somebody shed some light on this matter?