I use emacs as info viewer from the terminal, but if the info page does not exist (or there is any other error) the terminal (regardless of Kitty or Konsole) becomes hardly usable, not properly reacting to input, especially not processing enter anymore, as well as not properly handling the terminal width:

enter image description here

Tried the following unsuccessfully:

Currently I work around this by first checking whether an info page exists with info "$@" -w | grep -v "manpages" | grep -q ., but I would like a proper solution...

Edit: Somehow this happens due to the --tty flag, which also swallows the error message:

comparison with and without --tty

  • 1
    Does stty sane fix it?
    – phils
    Commented Aug 30, 2022 at 10:29
  • I can't reproduce your problem on my system, but I've also no idea how to test, as the ls output in your example seems fine, and yay isn't a program I have. What's a more common command which reproduces the issue? (Edit: oh, I see the weird % after the ls output now... well, I certainly don't see that, so I presume I'm not experiencing your issue.)
    – phils
    Commented Aug 30, 2022 at 10:33
  • stty sane fixes it, yeeha! It is also visible in that escape sequences are not properly handled anymore, so I see ^M and ^C in the terminal when typing RET and C-c, respectively. Maybe related to doom and my configuration...
    – xeruf
    Commented Aug 30, 2022 at 13:34

1 Answer 1


I had the same issue using zsh (Powerlevel10k) and Emacs (Spacemacs).

When I run git commit, it should open Emacs in terminal mode for me to enter the commit message. My .gitconfig is as follows:

    editor = emacsclient -c -a ''

Upon exiting Emacs, I'd see the same weird behavior in my terminal.

stty sane fixed the issue for me. Now I need to figure out how to run that automatically after leaving emacs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.