Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix(shell): treat DA2 terminal replies from an attached viewer as non-input so pasted prompts still submit

[._.]/ Adam Eivyd570fbea4447
diff --git a/server/services/shell.js b/server/services/shell.js
index 1e1560862f..fe95a7defb 100644
--- a/server/services/shell.js
+++ b/server/services/shell.js
@@ -694,7 +694,7 @@ export function getSessionProcess(sessionId) {
// in/out, CPR, DA1/DA2, DSR, and OSC color answers. An attached viewer emits
// these unprompted, so they are not a person typing over a pasted prompt.
// eslint-disable-next-line no-control-regex
-const TERMINAL_REPLY_RE = /^(?:\x1b\[[IO]|\x1b\[\??[\d;]*[Rcn]|\x1b\][\s\S]*?(?:\x07|\x1b\\))+$/;
+const TERMINAL_REPLY_RE = /^(?:\x1b\[[IO]|\x1b\[[?>]?[\d;]*[Rcn]|\x1b\][\s\S]*?(?:\x07|\x1b\\))+$/;
/**
* Write input to a shell session
diff --git a/server/services/shell.test.js b/server/services/shell.test.js
index 277a314f45..af76e089f4 100644
--- a/server/services/shell.test.js
+++ b/server/services/shell.test.js
@@ -758,6 +758,7 @@ describe('pasteToSession', () => {
shell.writeToSession(id, '\x1b[I');
shell.writeToSession(id, '\x1b[12;40R');
shell.writeToSession(id, '\x1b[?62;4c');
+ shell.writeToSession(id, '\x1b[>0;276;0c');
vi.advanceTimersByTime(1400);
expect(pty.write.mock.calls.filter(([data]) => data === '\r')).toHaveLength(3);