Skip to content

Commit a204db9

Browse files
committed
Add killall ui to /lsps
1 parent 2fb94a4 commit a204db9

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
@@ -593,22 +593,27 @@ export function Prompt(props: PromptProps) {
593593
}
594594

595595
const data = result.data ?? []
596-
if (data.length === 0) {
597-
toast.show({ message: "No LSP servers running", variant: "warning" })
598-
return
599-
}
596+
const opts = [
597+
{
598+
title: "Kill all LSP servers",
599+
value: "/lsps killall",
600+
description: "Stop every running LSP",
601+
footer: `${data.length} running`,
602+
},
603+
...data.map((item) => ({
604+
title: item.name,
605+
value: `/lsps kill ${item.name}`,
606+
description: item.root || ".",
607+
footer: "kill",
608+
})),
609+
]
600610

601611
dialog.replace(() => (
602612
<DialogSelect
603613
title="LSP Servers"
604-
options={data.map((item) => ({
605-
title: item.name,
606-
value: item.name,
607-
description: `/lsps kill ${item.name}`,
608-
footer: item.root || ".",
609-
}))}
614+
options={opts}
610615
onSelect={async (option) => {
611-
await runLsps(`/lsps kill ${option.value}`)
616+
await runLsps(option.value)
612617
await showLsps()
613618
}}
614619
/>

0 commit comments

Comments
 (0)