Skip to content

Commit 183f94e

Browse files
authored
Merge pull request #39 from kkroid/fix-shell-enter
修复命令行需要输入两次回车的问题
2 parents 40311ea + b372c7f commit 183f94e

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)