tui: keep trimming for normal submits; only raw ! triggers bash

This commit is contained in:
Vignesh Natarajan
2026-01-22 11:41:19 -08:00
committed by Peter Steinberger
parent 5fd699d0bf
commit 110b5dafee
4 changed files with 55 additions and 16 deletions

View File

@@ -50,7 +50,7 @@ describe("createEditorSubmitHandler", () => {
expect(sendMessage).toHaveBeenCalledWith("!");
});
it("does not trim input", () => {
it("trims normal messages before sending and adding to history", () => {
const editor = {
setText: vi.fn(),
addToHistory: vi.fn(),
@@ -68,7 +68,7 @@ describe("createEditorSubmitHandler", () => {
onSubmit(" hello ");
expect(sendMessage).toHaveBeenCalledWith(" hello ");
expect(editor.addToHistory).toHaveBeenCalledWith(" hello ");
expect(sendMessage).toHaveBeenCalledWith("hello");
expect(editor.addToHistory).toHaveBeenCalledWith("hello");
});
});