diff --git a/src/commands/list.ts b/src/commands/list.ts index 8eab874..166aef3 100644 --- a/src/commands/list.ts +++ b/src/commands/list.ts @@ -2,7 +2,7 @@ import { homedir } from "os" import * as git from "../git.ts" import * as vm from "../vm.ts" import * as state from "../state.ts" -import { reset, dim, bold, green, yellow, cyan, white } from "../fmt.ts" +import { reset, dim, bold, green, yellow, cyan, white, red } from "../fmt.ts" export async function action(opts: { json?: boolean }) { const root = await git.repoRoot() @@ -37,6 +37,9 @@ export async function action(opts: { json?: boolean }) { if (sessions.length === 0) { console.log("◆ No active sessions.") + if ((await vm.status()) !== "running") { + console.log(`${red}VM is not running.${reset}`) + } return } @@ -77,4 +80,8 @@ export async function action(opts: { json?: boolean }) { } console.log(`\n${dim}◯ idle${reset} · ${cyan}◎ active${reset} · ${yellow}◐ unsaved${reset} · ${green}● saved${reset}`) + + if ((await vm.status()) !== "running") { + console.log(`${red}VM is not running.${reset}`) + } } diff --git a/src/fmt.ts b/src/fmt.ts index 7a475db..2bafd68 100644 --- a/src/fmt.ts +++ b/src/fmt.ts @@ -4,6 +4,7 @@ export const reset = "\x1b[0m" export const dim = "\x1b[2m" export const green = "\x1b[32m" export const yellow = "\x1b[33m" +export const red = "\x1b[31m" export const cyan = "\x1b[36m" // ── Formatted output ────────────────────────────────────────────────