Last active
August 8, 2023 15:01
-
-
Save nikolovlazar/21a78f492e117a5e0dca1685cb668f4d 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: Atach to a tmux session | |
// Author: Lazar Nikolov | |
// Twitter: @NikolovLazar | |
import '@johnlindquist/kit'; | |
const sessionsCmd = await $`tmux list-sessions`; | |
let sessions = sessionsCmd.stdout | |
.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