diff --git a/packages/pi-tui/src/components/editor.ts b/packages/pi-tui/src/components/editor.ts index 35508bc55..df3c4bb64 100644 --- a/packages/pi-tui/src/components/editor.ts +++ b/packages/pi-tui/src/components/editor.ts @@ -559,7 +559,9 @@ export class Editor implements Component, Focusable { this.state.cursorLine = result.cursorLine; this.setCursorCol(result.cursorCol); - if (this.autocompletePrefix.startsWith("/")) { + if (this.autocompletePrefix.startsWith("/") || this.isInSlashCommandContext( + (this.state.lines[this.state.cursorLine] || "").slice(0, this.state.cursorCol), + )) { this.cancelAutocomplete(); // Fall through to submit } else {