Sort repositories alphabetically by name in list --all output

This commit is contained in:
Chris Wanstrath 2026-03-23 21:35:20 -07:00
parent d402a3f980
commit e71ba84cc0

View File

@ -130,7 +130,8 @@ export async function action(opts: { json?: boolean; all?: boolean }) {
if (opts.all) {
const byRepo = Map.groupBy(sessions, s => s.repoRoot)
for (const [repoRoot, repoSessions] of byRepo) {
const sorted = [...byRepo.entries()].sort((a, b) => basename(a[0]).localeCompare(basename(b[0])))
for (const [repoRoot, repoSessions] of sorted) {
console.log(`\n${dim}── ${reset}${basename(repoRoot)}${dim} ──${reset}`)
renderSessions(repoSessions, statusMap)
}