Created
August 8, 2023 13:31
-
-
Save nikolovlazar/a233d1522f2109fdf6c4b3da3b7454bc 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