diff --git a/ghostty/config b/ghostty/config index 35b03bd..c44116b 100644 --- a/ghostty/config +++ b/ghostty/config @@ -20,6 +20,7 @@ scrollback-limit = 10000 window-inherit-working-directory = true copy-on-select = clipboard shell-integration-features = no-cursor +command = ~/.config/ghostty/ghostty-tmux # macOS-specific settings alpha-blending = linear diff --git a/ghostty/ghostty-tmux b/ghostty/ghostty-tmux new file mode 100755 index 0000000..673bb56 --- /dev/null +++ b/ghostty/ghostty-tmux @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +SESSION_NAME="ghostty" + +# Check if the session already exists +tmux has-session -t "$SESSION_NAME" 2>/dev/null + +if [ $? -eq 0 ]; then + # If the session exists, reattach to it + tmux attach-session -t "$SESSION_NAME" +else + # If the session doesn't exist, start a new one + tmux new-session -s "$SESSION_NAME" -d + tmux attach-session -t "$SESSION_NAME" +fi