Merge branch 'sandlot-list'

This commit is contained in:
Chris Wanstrath 2026-02-19 11:21:24 -08:00
commit de0a3487e4
2 changed files with 15 additions and 2 deletions

View File

@ -125,10 +125,12 @@ program
process.exit(1)
}
const effectivePrompt = opts.print || prompt
await state.setSession(root, {
branch,
worktree: worktreeAbs,
created_at: new Date().toISOString(),
...(effectivePrompt ? { prompt: effectivePrompt } : {}),
})
if (opts.print) {
@ -168,10 +170,15 @@ program
return
}
const home = homedir()
const tilde = (p: string) => p.startsWith(home) ? "~" + p.slice(home.length) : p
const branchWidth = Math.max(6, ...sessions.map((s) => s.branch.length))
console.log(`${"BRANCH".padEnd(branchWidth)} WORKTREE`)
const worktreeWidth = Math.max(8, ...sessions.map((s) => tilde(s.worktree).length + 1))
console.log(`${"BRANCH".padEnd(branchWidth)} ${"WORKTREE".padEnd(worktreeWidth)} PROMPT`)
for (const s of sessions) {
console.log(`${s.branch.padEnd(branchWidth)} ${s.worktree}/`)
const wt = tilde(s.worktree) + "/"
console.log(`${s.branch.padEnd(branchWidth)} ${wt.padEnd(worktreeWidth)} ${s.prompt ?? ""}`)
}
})
@ -193,6 +200,11 @@ program
process.exit(1)
}
const effectivePrompt = opts.print || prompt
if (effectivePrompt) {
await state.setSession(root, { ...session, prompt: effectivePrompt })
}
const spin = spinner("Starting container")
await vm.ensure((msg) => { spin.text = msg })

View File

@ -4,6 +4,7 @@ export interface Session {
branch: string
worktree: string
created_at: string
prompt?: string
}
export interface State {