Skip to content

Commit 489c128

Browse files
committed
Add killall ui to /lsps
1 parent fef0d7d commit 489c128

2 files changed

Lines changed: 19 additions & 11 deletions

File tree

.opencode/agent/translator.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,9 @@ opencode.server.close()
422422
/instance/dispose
423423
/log
424424
/lsp
425+
/lsps
426+
/lsps/killall
427+
/lsps/kill/<name>
425428
/mcp
426429
/mnt/
427430
/mnt/c/

packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -559,22 +559,27 @@ export function Prompt(props: PromptProps) {
559559
}
560560

561561
const data = result.data ?? []
562-
if (data.length === 0) {
563-
toast.show({ message: "No LSP servers running", variant: "warning" })
564-
return
565-
}
562+
const opts = [
563+
{
564+
title: "Kill all LSP servers",
565+
value: "/lsps killall",
566+
description: "Stop every running LSP",
567+
footer: `${data.length} running`,
568+
},
569+
...data.map((item) => ({
570+
title: item.name,
571+
value: `/lsps kill ${item.name}`,
572+
description: item.root || ".",
573+
footer: "kill",
574+
})),
575+
]
566576

567577
dialog.replace(() => (
568578
<DialogSelect
569579
title="LSP Servers"
570-
options={data.map((item) => ({
571-
title: item.name,
572-
value: item.name,
573-
description: `/lsps kill ${item.name}`,
574-
footer: item.root || ".",
575-
}))}
580+
options={opts}
576581
onSelect={async (option) => {
577-
await runLsps(`/lsps kill ${option.value}`)
582+
await runLsps(option.value)
578583
await showLsps()
579584
}}
580585
/>

0 commit comments

Comments
 (0)