diff --git a/src/ui/App.tsx b/src/ui/App.tsx index c35ad05..cdbc8e5 100644 --- a/src/ui/App.tsx +++ b/src/ui/App.tsx @@ -700,8 +700,8 @@ export function App(props: { readonly session: T3Session; readonly config: Tui3C const editorKey: Binding | null = hasComposer ? { keys: ["ctrl+g"], run: openEditor, command: { id: "editor", title: "Write the message in $EDITOR", keywords: ["vim", "editor", "compose"] } } : null; const nextThreadKey: Binding = { keys: ["ctrl+n", "alt+↓"], label: "ctrl+n/p", run: () => move(1) }; const previousThreadKey: Binding = { keys: ["ctrl+p", "alt+↑"], run: () => move(-1) }; - // One-line inputs keep ctrl+u and ctrl+d for editing. - const lineInput = mode === "filter"; + // Anywhere with a text field, ctrl+u and ctrl+d edit (delete to line start, delete forward); page up/down still scroll. + const lineInput = mode === "filter" || mode === "input" || mode === "find" || mode === "palette" || mode === "picker" || mode === "confirm"; const globalKeys = keys( quitKey, paletteKey, diff --git a/test/app/app.test.tsx b/test/app/app.test.tsx index def306b..82655a0 100644 --- a/test/app/app.test.tsx +++ b/test/app/app.test.tsx @@ -195,6 +195,14 @@ describe("composer", () => { expect(app.calls("sendMessage").map((call) => [call.args[0], call.args[1]])).toEqual([[v2ThreadId, "hello there"]]); }); + test("ctrl+u deletes to the start of the line rather than scrolling", async () => { + const app = await open(); + await app.press("i"); + await app.type("hello there"); + await app.press("u", { ctrl: true }); + expect(app.frame()).not.toContain("hello there"); + }); + test("c starts a new thread draft; esc twice cancels it", async () => { const app = await open(); await app.press("c");