Show session list by default when sessions exist

This commit is contained in:
Chris Wanstrath 2026-02-20 12:16:18 -08:00
parent 3e423a3b37
commit cc3793593d

View File

@ -801,6 +801,18 @@ complete -c sandlot -n "__fish_seen_subcommand_from vm; and not __fish_seen_subc
`) `)
}) })
// Default: show list if sessions exist, otherwise help
const args = process.argv.slice(2)
if (args.length === 0) {
try {
const root = await git.repoRoot()
const st = await state.load(root)
if (Object.keys(st.sessions).length > 0) {
process.argv.push("list")
}
} catch {}
}
program.parseAsync().catch((err) => { program.parseAsync().catch((err) => {
console.error(`${err.message ?? err}`) console.error(`${err.message ?? err}`)
process.exit(1) process.exit(1)