ENG-501/Detection of command termination using Ctrl+C (#2960)

* Detect Ctrl C input when users terminal a long running terminal command

* Remove terminal-output-truncation.md documentation file
This commit is contained in:
canvrno authored and GitHub committed 2025-04-17 17:23:29 -07:00
1 parent fb3105f7bf
commit 022fdf47c0
2 files changed
+14

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
"claude-dev": patch
---
Detect Ctrl+C termination of terminal activity on long running commands
@@ -94,6 +94,15 @@ export class TerminalProcess extends EventEmitter<TerminalProcessEvents> {
data = stripAnsi(data)
}
// Ctrl+C detection: if user presses Ctrl+C, treat as command terminated
if (data.includes("^C") || data.includes("\u0003")) {
if (this.hotTimer) {
clearTimeout(this.hotTimer)
}
this.isHot = false
break
}
// first few chunks could be the command being echoed back, so we must ignore
// note this means that 'echo' commands won't work
if (!didOutputNonCommand) {