Greetings, When I run sh with the parameters exec env ENV='' HISTFILE=/dev/null PROMPT_COMMAND='' PS1=\#\$\ PS2='' PS3='' /bin/sh instead of getting back the expected "#$ ", I get "#$ [6n" i.e. the control character "^[[6n" is appended to the output. This causes issues when using tramp and sh to edit files on busybox via emacs, since it tries to match the output with "#$ ". When the same is run on other shells (such as bash), the control character is not present. This bug was discovered in alpine linux version 3.3.3, for which a docker container can be run via "docker run -it --rm --name alpine alpine sh", which will start the busybox shell.
The bug is also reproducible in the busybox docker image, runnable with "docker run -it --name busybox --rm busybox sh"
So apparently this is caused by EDITING_ASK_TERMINAL
(In reply to Matthias Pall Gissurarson from comment #2) > So apparently this is caused by EDITING_ASK_TERMINAL Yes. But sh (to be more precise, lineedit.c code) uses that _only_ if run on a tty. Are you scraping tty output? Why?