DEV Community

Discussion on: Linux terminals, tty, pty and shell - part 2

Collapse
 
anthony6075 profile image
Anthony6075

Thanks for your great article! But I have a very small question about the golang program.
In the server side, you coded "ptmx, e := pty.Start(c)", but I think maybe "ptm" is better than "ptmx" to be used as the variable name.
Because "ptmx" means "pseudoterminal multiplexor", which is used to create a pseudoterminal master and slave pair.(man7.org/linux/man-pages/man4/pts....) Here, we just get a pseudoterminal master by calling "pty.Start(c)". So, maybe "ptm" is better.
Yes, I know go pty module documentation examples(pkg.go.dev/github.com/creack/pty#r...) use "ptmx" too. But how do you think?
Thank you in advance!