aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2024-09-24 23:20:58 +0200
committerEgor Tensin <egor@tensin.name>2024-09-24 23:20:58 +0200
commite3394208d9b403a7d1ed7c462fa135ec5cd26956 (patch)
treeac247ddd6f13356a56e881cae7ad42469c2d02fb
parentnnn: fix the list of archive formats (diff)
downloadlinux-home-master.tar.gz
linux-home-master.zip
tmux: create new sessions locallyHEADmaster
Diffstat (limited to '')
-rw-r--r--%HOME%/.bashrc8
1 files changed, 7 insertions, 1 deletions
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: