Skip to content

Instantly share code, notes, and snippets.

@Skatox
Created September 12, 2025 13:29
Show Gist options
  • Save Skatox/4b127f5969ffea6fdfb74d8674b2a960 to your computer and use it in GitHub Desktop.
Save Skatox/4b127f5969ffea6fdfb74d8674b2a960 to your computer and use it in GitHub Desktop.
Always open Ghostty with a tmux session
#!/bin/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment