Running top in ssh

When you try to run the following command: ssh server.example.com top You get the following error: TERM environment variable not set. You have to launch ssh with the -t option: ssh -t server.example.com top top - 16:26:49 up 2 days, 1:10, 2 users, load average: 0.45, 0.74, 0.83 Tasks: 163 total, 1 running, 162 sleeping, 0 stopped, 0 zombie %Cpu0 : 3.6 us, 2.0 sy, 0.0 ni, 94.1 id, 0.0 wa, 0.0 hi, 0.3 si, 0.0 st %Cpu1 : 6.3 us, 2.3 sy, 0.0 ni, 91.4 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st %Cpu2 : 2.6 us, 2.6 sy, 0.0 ni, 94.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st %Cpu3 : 3.0 us, 5.0 sy, 0.0 ni, 92.1 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st MiB Mem : 2020.4 total, 365.2 free, 674.1 used, 981.0 buff/cache MiB Swap: 0.0 total, 0.0 free, 0.0 used. 949.8 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 7353 netdata 20 0 7424 4564 2060 S 7.3 0.2 199:28.26 apps.plugin 7351 netdata 20 0 144992 35504 6004 S 6.3 1.7 165:06.90 python 6813 netdata 20 0 333060 125596 4868 S 5.9 6.1 129:06.09 netdata 5514 mysql 20 0 585604 90964 8920 S 3.3 4.4 122:51.24 mysqld 5924 gitea 20 0 969964 150968 42028 S 3.3 7.3 97:29.85 gitea 7346 netdata 20 0 811060 16756 9592 S 1.7 0.8 57:24.51 go.d.plugin 27934 admin 20 0 9352 2468 1972 R 1.0 0.1 0:00.32 top 5239 root 20 0 218308 15888 6744 S 0.7 0.8 26:00.11 fail2ban-server 7 root 20 0 0 0 0 S 0.3 0.0 3:16.00 rcu_sched 5312 etherpa+ 20 0 163900 65488 24588 S 0.3 3.2 6:51.55 node 5393 redis 20 0 33480 2744 2004 S 0.3 0.1 10:57.95 redis-server 27082 netdata 20 0 2564 1968 1668 S 0.3 0.1 0:02.71 bash 1 root 20 0 33328 8284 5220 S 0.0 0.4 1:17.77 systemd 2 root 20 0 0 0 0 S 0.0 0.0 0:00.06 kthreadd 3 root 20 0 0 0 0 S 0.0 0.0 0:16.78 ksoftirqd/0 8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh 9 root rt 0 0 0 0 S 0.0 0.0 0:02.58 migration/0 10 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 lru-add-drain 11 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/0 12 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/1