Sample Header Ad - 728x90

In tmux on remote machine, each new line in terminal is indented to the end of the previously displayed line

2 votes
1 answer
1113 views
## Update: Solved thanks to comment by @NotTheDr01ds ### Original question (Details of the machines I'm using at end) I connect to a my Uni's VPN using: sudo /sbin/modprobe tun && sudo openconnect gucsasa1.cent.gla.ac.uk I get this output:
POST https://gucsasa1.cent.gla.ac.uk/ 
Got CONNECT response: HTTP/1.1 200 OK
CSTP connected. DPD 30, Keepalive 20
Connected as 172.20.183.165, using SSL, with DTLS in progress
Established DTLS connection (using GnuTLS). Ciphersuite (DTLS1.2)-(ECDHE-RSA)-(AES-256-GCM).
Unknown DTLS packet type 13, len 16
Then I run the following command to connect via ssh:
ssh -X mymachine
Once connected, my .bashrc on the server tries to automatically launches tmux (version 2.6):
# Launch tmux
if command -v tmux>/dev/null; then
    [[ ! $TERM =~ screen ]] && [ -z $TMUX ] && tmux new-session -A -s main
fi
But it instantly crashes leaving my terminal display looking like this (here I typed ls to show the problem, but it happens with all stdout): After typing 'clear' and then typing 'ls' I also can't see anything I'm typing into the terminal - i.e. it doesn't update the display until I hit enter on the command (having typed it 'blind'). When using the -X and -Y flags with ssh, I have no problems with GUI programs. This is specific to stdout rendering in the terminal in tmux. After googling, I found that typing reset brought back a 'normal' experience, but also killed the tmux server. Here is the result of typing ls: After typing 'reset' and then typing 'ls' As soon as I try to launch tmux, it crashes again and I'm back to the original problem. I don't have this problem when I connect to other servers (running Debian 10, and Ubuntu 20.04, bash and tmux 2.8) using the same client machine and same terminal. Does anyone have any ideas of how I can troubleshoot this issue? I've been googling all day without success. #### Client machine - OS: lubuntu 20.04 - terminal: st - shell: bash - In tmux session: echo $TERM: st-256color - Outside tmux session: echo $TERM: screen-256color #### Server machine - OS: Ubuntu 18.04 - terminal: gnome-terminal - shell: bash - Outside tmux session: echo $TERM: st-256color
Asked by mattb (937 rep)
Dec 23, 2021, 03:46 PM
Last activity: Dec 31, 2021, 08:06 AM