PC & IT SUPPORT MADE EASY FORUM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Reconnect to broken terminal session using tmux.

Go down

Reconnect to broken terminal session using tmux. Empty Reconnect to broken terminal session using tmux.

Post by jamied_uk 23rd July 2021, 10:57

TMUX terminal sharing cross platform



# Reconnect to broken terminal session using tmux.
# Start the operation & If connection has been broken, just reconnect by typing
# tmux attach.


Here's an example.

tmux
make
......
Connection fails for some reason
Reconect

tmux ls
0: 1 windows (created Tue Aug 23 12:39:52 2011) [103x30]

Code:
tmux attach -t 0



Back in the tmux sesion! Very Happy


tmux ls
0: 1 windows (created Fri Jul 23 10:36:30 2021) [80x24]
1: 1 windows (created Fri Jul 23 10:36:30 2021) [80x23] (attached)
Code:
tmux attach -t 2:0



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This will start tmux session if not already started else it will join an existing session

Just put this in your ~/.tmux.conf file:

# if run as "tmux attach", create a session if one does not already exist
new-session -n $HOST

If you run tmux attach and there is a session, then it will attach to that session (whether it's already attached or not). If there is not a session already then it will create one for you.
jamied_uk
jamied_uk
Admin

Posts : 2951
Join date : 2010-05-09
Age : 41
Location : UK

https://jnet.sytes.net

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum