I have screen session "main", started in /dev/ttySAC0 and sh, started in /dev/ttySAC0 (outside screen session) with input, output and error streams, redirected to pseudoterminal /dev/pts/1. When I attach to /dev/pts/1 terminal and try to run screen -r main, it fails with:

WriteMessage: Bad file descriptor

But creating new screen session with screen works fine. Furthermore, if I run screen -r main in this screen session, I got screen with my saved session in another screen session. It's not usefull, but it's works.

Even if I starts new session in /dev/pts/1, detatch from it and try to revive it, I got same error.


Run screen -d, find the screens and run screen -R [screen_name].


Try adding the line defnonblock on to your ~/.screenrc file.

When I began having the same problem I found a few posts mentioning that it fixed their issues. It fixed mine.

  • It didn't help. – Paboka Feb 13 '17 at 5:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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