Created
August 8, 2023 13:30
-
-
Save nikolovlazar/78dc09fbb1950a943b26fa8046c87247 to your computer and use it in GitHub Desktop.
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
// Name: tmux sesh | |
// Description: Opens a tmux session | |
import '@johnlindquist/kit'; | |
const sessionsCmd = await $`tmux list-sessions`; | |
let sessions = sessionsCmd.stdout; | |
sessions = sessions | |
.split('\n') | |
.map((line) => line.split(':')[0]) | |
.filter((sesh) => !!sesh); | |
let choice = await arg('Attach to session:', sessions); | |
await $`kitty --hold sh -c "tmux a -t ${choice}"`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment