Remove worktree column from sessions list output
This commit is contained in:
parent
e5085d50ed
commit
84ff27fd8e
|
|
@ -170,15 +170,10 @@ program
|
||||||
return
|
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))
|
const branchWidth = Math.max(6, ...sessions.map((s) => s.branch.length))
|
||||||
const worktreeWidth = Math.max(8, ...sessions.map((s) => tilde(s.worktree).length + 1))
|
console.log(`${"BRANCH".padEnd(branchWidth)} PROMPT`)
|
||||||
console.log(`${"BRANCH".padEnd(branchWidth)} ${"WORKTREE".padEnd(worktreeWidth)} PROMPT`)
|
|
||||||
for (const s of sessions) {
|
for (const s of sessions) {
|
||||||
const wt = tilde(s.worktree) + "/"
|
console.log(`${s.branch.padEnd(branchWidth)} ${s.prompt ?? ""}`)
|
||||||
console.log(`${s.branch.padEnd(branchWidth)} ${wt.padEnd(worktreeWidth)} ${s.prompt ?? ""}`)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user