From 14f56a4e18ac75bbf319a5fba12535bd7c7097b5 Mon Sep 17 00:00:00 2001 From: CJ Winslow Date: Sun, 18 Jan 2026 15:50:27 -0800 Subject: [PATCH] TUI: use editor keybindings for select cancel action Replace hardcoded escape sequence checks with the pi-tui keybindings API to ensure consistent cancel handling across different terminal configurations. --- src/tui/components/filterable-select-list.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tui/components/filterable-select-list.ts b/src/tui/components/filterable-select-list.ts index cc65e767f..c65a9e91f 100644 --- a/src/tui/components/filterable-select-list.ts +++ b/src/tui/components/filterable-select-list.ts @@ -4,6 +4,7 @@ import { SelectList, type SelectListTheme, fuzzyFilter, + getEditorKeybindings, } from "@mariozechner/pi-tui"; import type { Component } from "@mariozechner/pi-tui"; import chalk from "chalk"; @@ -109,7 +110,8 @@ export class FilterableSelectList implements Component { } // Escape: clear filter or cancel - if (keyData === "\x1b" || keyData === "\x1b\x1b") { + const kb = getEditorKeybindings(); + if (kb.matches(keyData, "selectCancel")) { if (this.filterText) { this.filterText = ""; this.input.setValue("");