I'm working on a relatively new Linux Mint installation and I haven't noticed any significant issues until just now, I realised I couldn't use any command-line tools that interactively read user input. Instead of processing an enter key as I'd expect by consuming a line of input, it's printing the ^M
character sequence to the terminal and continuing to prompt for input.
E.g. with git add -p
:
Stage this hunk [y,n,q,a,d,j,J,g,/,e,?]? y^M
After a little more testing I realised that all shell read
operations were doing this (in zsh
and bash
), and sh
was entirely unusable.
zsh and bash:
$ read test
value^M^C
$
sh:
$ echo "test"^M^C
$ exit^M^M^M^C
$
I opened a new terminal and it seemed unaffected, so I'm not stuck here, but I'd love to know what happened to make this terminal behave as it is. I'll keep the broken one open for a while for testing if people have theories.
stty -icrnl
instead of plainstty
, so I think I've ruined my chances of investigating the exact state prior. However, I'm glad to have an understanding of how to both reproduce and fix the issue. Write them as an answer and I'll accept it. – Zoey Hewll Apr 17 '20 at 05:39