For standard shells (e.g., sh), the shell prompt is sometimes read from PTY on a wrong line: not with the echoed input, but with the output. For example, in the slightly modified multiline test: "echo \\\n$HOME" input command sometimes leads to ["$HOME", "> /home/user"] being captured as the last 2 lines instead of expected ["> $HOME", "/home/user"].
For standard shells (e.g.,
sh), the shell prompt is sometimes read from PTY on a wrong line: not with the echoed input, but with the output. For example, in the slightly modified multiline test:"echo \\\n$HOME"input command sometimes leads to["$HOME", "> /home/user"]being captured as the last 2 lines instead of expected["> $HOME", "/home/user"].