Android - How to prevent adb shell from exiting upon Ctrl+C

I found sort of a workaround for this (at least for a rooted phone). If a phone is rooted, busybox is most probably installed. stty is part of busybox.

stty intr ^x

Redefines Ctrl+X to act as a break command, e.g. what was previously Ctrl+C.


Alt-NumPad 3 + Enter works for me. Alt-NumPad 0-NumPad 3 + Enter also works and displays "^C".


i was able to stop the top process and still stay in shell by typing the following in this order:

C

CTRL+Z

CTRL+M

if I did not type all 3 of those combos it would not stop and I would have to CTRL+C to exit the shell. I found this by just trying different combinations of keys and found it by accident. YMMV

Tags:

Shell

Adb