Skip to content

Instantly share code, notes, and snippets.

@nikolovlazar
Created August 8, 2023 13:31
Show Gist options
  • Save nikolovlazar/a233d1522f2109fdf6c4b3da3b7454bc to your computer and use it in GitHub Desktop.
Save nikolovlazar/a233d1522f2109fdf6c4b3da3b7454bc to your computer and use it in GitHub Desktop.
// 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