Created
May 23, 2024 04:57
-
-
Save febriliankr/c318b1fb54c13c3d340b7e10d322d9ae to your computer and use it in GitHub Desktop.
This file contains 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
# open popup session in the current path, so single key can open or close popup with ease | |
bind-key -n M-u if-shell -F '#{==:#{session_name},scratch}' { | |
# Detach the client if the current session is "scratch" | |
detach-client | |
} { | |
# Check if a popup is already open to prevent multiple popups | |
if-shell '[ -n "#{popup_pid}" ]' { | |
display-message "Popup already open" | |
} { | |
# Capture the current path and display a popup to open or attach to "scratch" session | |
display-popup -E -w 90% -h 90% -x C -y C "tmux new-session -A -s scratch -c '#{pane_current_path}'" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment