Skip to content

Commit b372c7f

Browse files
author
will.zhang
committed
修复命令行需要输入两次回车的问题
1 parent 62bacdf commit b372c7f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/components/Device/DeviceAdbShellDialog.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ watch(() => visible.value, async (v) => {
2525
convertEol: true,
2626
})
2727
term.onData((data) => {
28-
shellController.send(data);
28+
if (data === '\r') {
29+
// 发送回车
30+
shellController.send('\r\n');
31+
} else {
32+
shellController.send(data);
33+
}
2934
})
3035
const fitAddon = new FitAddon();
3136
term.loadAddon(fitAddon);

0 commit comments

Comments
 (0)