This makes the output of previous commands and prompts immutable (by
default), so users can't accidentally alter them, which can leave the
buffer in a half-broken state (requiring the user flush out the garbled
input with a couple RETs).
This targets comint shells (shell, ielm, etc), eshell, (ansi-)term, and
any derivatives thereof.
Fix: #8411