Created
September 12, 2025 13:29
-
-
Save Skatox/4b127f5969ffea6fdfb74d8674b2a960 to your computer and use it in GitHub Desktop.
Always open Ghostty with a tmux session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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