Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to login to a pty instead of a serial port #8

Open
hackerb9 opened this issue Oct 8, 2022 · 3 comments
Open

Option to login to a pty instead of a serial port #8

hackerb9 opened this issue Oct 8, 2022 · 3 comments

Comments

@hackerb9
Copy link

hackerb9 commented Oct 8, 2022

Python has a pty (pseudo TTY) library, so it should be possible to open a shell on the current machine instead of requiring a connection over a serial port.

For example, I am trying to ascertain if an H19 terminal would work to connect to a TRS-80 Model 100 to provide a larger screen. The Model 100's internal screen codes appears to be based on something like an H19. For example, to position the cursor, one can use "PRINT CHR$(27)+Y+" ", just like on an H19.

I don't need a serial port to test this, but the h19term program currently requires one.

@horga83
Copy link
Owner

horga83 commented Oct 9, 2022 via email

@hackerb9
Copy link
Author

hackerb9 commented Oct 10, 2022

Thanks for the tip! That worked.

If you want to document how to do it for other people, here's what I did:

  1. Edit $HOME/.h19termrc and set
    [SerialComms]
    port = ttyH19
    
  2. Run socat to create a virtual serial port called "ttyH19" in the current directory:
    TERM=h19 LANG=C  socat PTY,link=ttyH19,wait-slave EXEC:bash,pty,ctty,login,stderr,setsid,sigint,sighup,sigquit,sane &
    
  3. In the same directory, run h19term.py.
    ./h19term.py
    

After that, you'll be logged into your current host in an H19 terminal. When you logout, h19term and socat will automatically quit.


By the way, thank you for creating h19term.py. I haven't used an H19 in a looooong time.

@horga83
Copy link
Owner

horga83 commented Oct 10, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants