Skip to content

Commit 057de69

Browse files
author
刘威
committed
fix: normalize adb terminal enter handling
1 parent 316f0e7 commit 057de69

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/main/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,11 @@ class TerminalManager {
528528
}
529529

530530
if (this.mode === 'adb' && this.adbProcess && this.adbProcess.stdin) {
531-
this.adbProcess.stdin.write(data);
531+
// xterm sends Enter as '\r', but piped `adb shell` on Windows expects '\n'.
532+
const normalized = typeof data === 'string'
533+
? data.replace(/\r(?!\n)/g, '\n')
534+
: data;
535+
this.adbProcess.stdin.write(normalized);
532536
return true;
533537
}
534538

0 commit comments

Comments
 (0)