Script Kit Logo
Script Kit
by John Lindquist
Free TutorialsTipsCommunity ScriptsDocsDiscussBlog
Lazar Nikolov
Scripts /

Lazar Nikolov

Attach to tmux session with Kitty terminal

by Lazar Nikolov

<img width="880" alt="CleanShot 2023-08-08 at 11 02 41@2x" src="https://github.com/johnlindquist/kit/assets/5396211/0be488c3-1176-4a7b-ad4d-7fac3b326e7a">
// Name: tmux sesh
// Description: Attach 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}"`;
created by
John Lindquist
GitHub