Skip to content

Commit

Permalink
Merge pull request #39 from kkroid/fix-shell-enter
Browse files Browse the repository at this point in the history
修复命令行需要输入两次回车的问题
  • Loading branch information
modstart authored Dec 31, 2024
2 parents 40311ea + b372c7f commit 183f94e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/Device/DeviceAdbShellDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ watch(() => visible.value, async (v) => {
convertEol: true,
})
term.onData((data) => {
shellController.send(data);
if (data === '\r') {
// 发送回车
shellController.send('\r\n');
} else {
shellController.send(data);
}
})
const fitAddon = new FitAddon();
term.loadAddon(fitAddon);
Expand Down

0 comments on commit 183f94e

Please sign in to comment.