From e3394208d9b403a7d1ed7c462fa135ec5cd26956 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 24 Sep 2024 23:20:58 +0200 Subject: tmux: create new sessions locally --- %HOME%/.bashrc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to '%HOME%') diff --git a/%HOME%/.bashrc b/%HOME%/.bashrc index a00285d..38bac50 100644 --- a/%HOME%/.bashrc +++ b/%HOME%/.bashrc @@ -191,7 +191,13 @@ elif multiplexed; then # Skip, we're already running a multiplexer. true elif command -v tmux &> /dev/null; then - exec tmux new -A -s main + # On a remote terminal, always connect to the same session; on a local + # terminal, create a new one every time a new terminal is opened. + if remote_terminal; then + exec tmux new -A -s main + elif local_terminal; then + exec tmux new + fi fi # Disable Alt+N shortcuts, which I use in tmux: -- cgit v1.2.3