2

I'm using bash and screen and catted /dev/sda1. This potentially outputted escape codes that changed screen's state. The closest question I found is Why using cat on binary files messed up the terminal and how?

I tried using reset and stty sane, but these do not appear to affect screen. They only affect the bash sessions inside. How can I reset or restore sanity to screen?

Here is how it looks

Messed up terminal

4
  • What awful terminal client could be doing something like that? May 9, 2016 at 5:03
  • I'm using gnome-terminal with screen and bash, if that's what you're asking.
    – user77362
    May 9, 2016 at 5:26
  • Oh, so screen must probably need to be restarted. I don't use that, tried it a few times and got too many problems with it. May 9, 2016 at 5:30
  • Well I've tried reconnecting, but restarting my screen would mean that I lose my vim session and other jobs in those terminals. Are you suggesting another multiplexer where this issue is easily resolved?
    – user77362
    May 9, 2016 at 5:32

2 Answers 2

2

It's possible for screen to be confused. You can detach your session, run reset outside screen, re-attach to the session and run reset within screen. With any reset, the terminal (or window) would be cleared, but at least you should be able to resume whatever is running in the window(s).

Besides reset, I find these useful (they do not make a full reset):

  • tput cnorm (make the cursor visible)
  • tput enacs (repairs line-drawing)

Your terminal may also have a reset feature, but that would be limited to setting the terminal's modes (such as line-drawing), and have little effect on resetting the I/O modes (such as newline-conversion), which can be a nuisance. When using reset, you may have to type

resetcontrolJ

to get the terminal's attention — both within and outside screen.

2
  • This solved the problem: Detach, reset, go back, c-a a to get a terminal, c-a Z to reset.
    – user77362
    May 9, 2016 at 14:33
  • Well only until I c-a a'd, then the problem came right back.
    – user77362
    May 9, 2016 at 15:12
1

Try C-a Z (GNU Screen 'reset')

1
  • This does not work, after doing this I have image
    – user77362
    May 9, 2016 at 14:31

You must log in to answer this question.