Text fields keep ctrl+u and ctrl+d for editing

This commit is contained in:
Callum Alpass committed 2026-11-02 23:26:01 +11:00
1 parent 49fc25f7a2
commit e857146c9a
2 files changed
+10 -2

No files matched your search

+2 -2
View File
@@ -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,
+8
View File
@@ -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");