Thursday 24 November 2011

Using Screen as a terminal emulator

I've been using ZTerm and various terminal emulation software on the Mac for a while.
Most have been a bit clunky, so I've reverted back to screen.
Came across an issue with it not connecting properly using my Keyspan USB to Serial adapter.
When I run the command:

 screen /dev/tty.USA19Hfa14P1.1

I get the following error:

  Cannot open line 'dev/tty.USA19Hfa14P1.1' for R/W. Resource busy.
  Sorry, could not find a PTY.

After some digging around turns out that when I last used screen, I didn't exit out of it properly.
Out of doing a: ps -f

  ps -f

  UID   PID  PPID   C     STIME TTY           TIME CMD
  501   666     1   0   0:00.00 tty.KeySerial1   0:00.00 SCREEN /dev/tty.USA19Hfa14P1.1
  501   670   669   0   0:00.01 ttys000    0:00.02 -bash

I killed the process:

 kill 666

Tried to use screen again and it worked this time around.
This is a reminder, more to myself, that you should always exit screen using the CONTROL-A followed by the CONTROL-\.

5 comments:

  1. Hey thanks for this! Saved me a lot of time and frustration

    ReplyDelete
  2. Many thanks for the post. It fixed a problem I was having connecting my Raspberry Pi to a Mac with a serial cable.

    ReplyDelete
  3. Thanks, had the same problem connecting my CHIP to a Mac. screen has some powerful options!

    ReplyDelete
  4. Thanks, had the same problem connecting my CHIP to a Mac. screen has some powerful options!

    ReplyDelete
  5. I was having the same issue with my terminal session when trying to connect to my switches via serial and this helped immensely, thank you!

    ReplyDelete