13

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.

3 Answers 3

7

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

4

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.

1
  • It didn't help.
    – Paboka
    Feb 13, 2017 at 5:29
1

It happens if I have a screen with the same name as another screen + more text after it, the screen name without the extra text breaks, ie

~$ screen -ls
        7385.foo-screen      (02/27/2020 12:03:41 AM)        (Detached)
        7296.foo-screen-2    (02/27/2020 12:00:48 AM)        (Detached)

works:

~$ screen -r foo-screen-2 

fails:

~$ screen -r foo-screen 
WriteMessage: Bad file descriptor

works:

~$ screen -r 7385.foo-screen 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .