aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--zsh/.zsh/tmux.sh5
-rwxr-xr-xzsh/.zshrc1
2 files changed, 6 insertions, 0 deletions
diff --git a/zsh/.zsh/tmux.sh b/zsh/.zsh/tmux.sh
new file mode 100644
index 0000000..323a8ec
--- /dev/null
+++ b/zsh/.zsh/tmux.sh
@@ -0,0 +1,5 @@
+#!/usr/bin/env zsh
+
+if [[ "$TERM" != "tmux-256color" ]]; then
+ tmux attach-session -t "$USER" || tmux new-session -s "$USER"
+fi
diff --git a/zsh/.zshrc b/zsh/.zshrc
index b257360..de4f6b0 100755
--- a/zsh/.zshrc
+++ b/zsh/.zshrc
@@ -1,6 +1,7 @@
#!/usr/bin/env zsh
source ~/.zsh/prompt.sh
+source ~/.zsh/tmux.sh
autoload -Uz compinit
compinit