mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-22 18:24:21 +01:00
add command bar option to interrupt session
This commit is contained in:
@@ -156,10 +156,11 @@ export function Prompt(props: PromptProps) {
|
|||||||
title: "Interrupt session",
|
title: "Interrupt session",
|
||||||
value: "session.interrupt",
|
value: "session.interrupt",
|
||||||
keybind: "session_interrupt",
|
keybind: "session_interrupt",
|
||||||
|
disabled: status() !== "working",
|
||||||
category: "Session",
|
category: "Session",
|
||||||
disabled: true,
|
|
||||||
onSelect: (dialog) => {
|
onSelect: (dialog) => {
|
||||||
if (!props.sessionID) return
|
if (!props.sessionID) return
|
||||||
|
if (autocomplete.visible) return
|
||||||
sdk.client.session.abort({
|
sdk.client.session.abort({
|
||||||
path: {
|
path: {
|
||||||
id: props.sessionID,
|
id: props.sessionID,
|
||||||
@@ -602,16 +603,6 @@ export function Prompt(props: PromptProps) {
|
|||||||
)
|
)
|
||||||
input.cursorOffset = input.plainText.length
|
input.cursorOffset = input.plainText.length
|
||||||
}
|
}
|
||||||
if (!autocomplete.visible) {
|
|
||||||
if (keybind.match("session_interrupt", e) && props.sessionID) {
|
|
||||||
sdk.client.session.abort({
|
|
||||||
path: {
|
|
||||||
id: props.sessionID,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
onSubmit={submit}
|
onSubmit={submit}
|
||||||
onPaste={async (event: PasteEvent) => {
|
onPaste={async (event: PasteEvent) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user