fix: e2e tests corrupted by bash's readline echo on a readline /bin/sh
e2e_start disables the pty's kernel ECHO flag so a test's own "typed"
command text doesn't leak into the output stream ahead of the command's
real output — but on a system where /bin/sh is (a symlink to) bash
built with readline, e.g. NixOS's default, bash's readline echoes back
whatever it reads using its own redisplay logic, entirely independent
of that kernel flag. Reproduced deterministically (100% of runs, single
test, single thread — not a timing race) on a NixOS host: fragments of
a test's own command/marker text (e.g. "IL" from "ILDONE1", "D" from
"ICDONE2") showed up at the position readline echoed them to, instead
of the real escape-sequence-driven content, failing
test_e2e_char_editing, test_e2e_line_editing, and
test_e2e_tmux_secondary_da_no_corruption. Never reproduced on a dash
/bin/sh (no built-in line editing to race with), which is what this
dev environment and CI's earlier local testing both happened to have.
`set +o emacs +o vi` is bash's documented way to fall back to reading
input without readline; dash has neither option and just errors
harmlessly on stderr (already discarded, same as the PS1 assignment
right after it). Sent unconditionally before the READY handshake so it
applies regardless of which shell /bin/sh actually resolves to.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KpDBFeBQKx9f5U3pfVeVV3