TUI: coalesce multiline paste submits on macOS terminals

This commit is contained in:
Vignesh Natarajan
2026-02-21 19:19:55 -08:00
parent f2d664e24f
commit a10d689860
3 changed files with 37 additions and 3 deletions

View File

@@ -20,6 +20,7 @@ Docs: https://docs.openclaw.ai
- Agents/Ollama: preserve unsafe integer tool-call arguments as exact strings during NDJSON parsing, preventing large numeric IDs from being rounded before tool execution. (#23170) Thanks @BestJoester. - Agents/Ollama: preserve unsafe integer tool-call arguments as exact strings during NDJSON parsing, preventing large numeric IDs from being rounded before tool execution. (#23170) Thanks @BestJoester.
- Cron/Gateway: keep `cron.list` and `cron.status` responsive during startup catch-up by avoiding a long-held cron lock while missed jobs execute. (#23106) Thanks @jayleekr. - Cron/Gateway: keep `cron.list` and `cron.status` responsive during startup catch-up by avoiding a long-held cron lock while missed jobs execute. (#23106) Thanks @jayleekr.
- Gateway/Config reload: compare array-valued config paths structurally during diffing so unchanged `memory.qmd.paths` and `memory.qmd.scope.rules` no longer trigger false restart-required reloads. (#23185) Thanks @rex05ai. - Gateway/Config reload: compare array-valued config paths structurally during diffing so unchanged `memory.qmd.paths` and `memory.qmd.scope.rules` no longer trigger false restart-required reloads. (#23185) Thanks @rex05ai.
- TUI/Input: enable multiline-paste burst coalescing on macOS Terminal.app and iTerm so pasted blocks no longer submit line-by-line as separate messages. (#18809) Thanks @fwends.
- Gateway/Pairing: treat operator.admin pairing tokens as satisfying operator.write requests so legacy devices stop looping through scope-upgrade prompts introduced in 2026.2.19. (#23125, #23006) Thanks @vignesh07. - Gateway/Pairing: treat operator.admin pairing tokens as satisfying operator.write requests so legacy devices stop looping through scope-upgrade prompts introduced in 2026.2.19. (#23125, #23006) Thanks @vignesh07.
- Memory/QMD: add optional `memory.qmd.mcporter` search routing so QMD `query/search/vsearch` can run through mcporter keep-alive flows (including multi-collection paths) to reduce cold starts, while keeping searches on agent-scoped QMD state for consistent recall. (#19617) Thanks @nicole-luxe and @vignesh07. - Memory/QMD: add optional `memory.qmd.mcporter` search routing so QMD `query/search/vsearch` can run through mcporter keep-alive flows (including multi-collection paths) to reduce cold starts, while keeping searches on agent-scoped QMD state for consistent recall. (#19617) Thanks @nicole-luxe and @vignesh07.
- Chat/UI: strip inline reply/audio directive tags (`[[reply_to_current]]`, `[[reply_to:<id>]]`, `[[audio_as_voice]]`) from displayed chat history, live chat event output, and session preview snippets so control tags no longer leak into user-visible surfaces. - Chat/UI: strip inline reply/audio directive tags (`[[reply_to_current]]`, `[[reply_to:<id>]]`, `[[audio_as_voice]]`) from displayed chat history, live chat event output, and session preview snippets so control tags no longer leak into user-visible surfaces.

View File

@@ -130,10 +130,32 @@ describe("shouldEnableWindowsGitBashPasteFallback", () => {
).toBe(true); ).toBe(true);
}); });
it("disables fallback outside Windows", () => { it("enables fallback on macOS iTerm", () => {
expect( expect(
shouldEnableWindowsGitBashPasteFallback({ shouldEnableWindowsGitBashPasteFallback({
platform: "darwin", platform: "darwin",
env: {
TERM_PROGRAM: "iTerm.app",
} as NodeJS.ProcessEnv,
}),
).toBe(true);
});
it("enables fallback on macOS Terminal.app", () => {
expect(
shouldEnableWindowsGitBashPasteFallback({
platform: "darwin",
env: {
TERM_PROGRAM: "Apple_Terminal",
} as NodeJS.ProcessEnv,
}),
).toBe(true);
});
it("disables fallback outside Windows", () => {
expect(
shouldEnableWindowsGitBashPasteFallback({
platform: "linux",
env: { env: {
MSYSTEM: "MINGW64", MSYSTEM: "MINGW64",
} as NodeJS.ProcessEnv, } as NodeJS.ProcessEnv,

View File

@@ -84,13 +84,24 @@ export function shouldEnableWindowsGitBashPasteFallback(params?: {
env?: NodeJS.ProcessEnv; env?: NodeJS.ProcessEnv;
}): boolean { }): boolean {
const platform = params?.platform ?? process.platform; const platform = params?.platform ?? process.platform;
const env = params?.env ?? process.env;
const termProgram = (env.TERM_PROGRAM ?? "").toLowerCase();
// Some macOS terminals emit multiline paste as rapid single-line submits.
// Enable burst coalescing so pasted blocks stay as one user message.
if (platform === "darwin") {
if (termProgram.includes("iterm") || termProgram.includes("apple_terminal")) {
return true;
}
return false;
}
if (platform !== "win32") { if (platform !== "win32") {
return false; return false;
} }
const env = params?.env ?? process.env;
const msystem = (env.MSYSTEM ?? "").toUpperCase(); const msystem = (env.MSYSTEM ?? "").toUpperCase();
const shell = env.SHELL ?? ""; const shell = env.SHELL ?? "";
const termProgram = (env.TERM_PROGRAM ?? "").toLowerCase();
if (msystem.startsWith("MINGW") || msystem.startsWith("MSYS")) { if (msystem.startsWith("MINGW") || msystem.startsWith("MSYS")) {
return true; return true;
} }