Skip to content

Pseudo terminal #3339

Answered by fswarbrick
fswarbrick asked this question in Q&A
Jun 11, 2024 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

I believe I have found what I am looking for. In the "terminal" package, in file vt_posix.go, there is a function (t *VT) Parse(). It's described as:

// Parse blocks on read on pty or io.ReadCloser, then parses sequences until
// buffer empties. State is locked as soon as first rune is read, and unlocked
// when buffer is empty.

In it there is a for loop, where the first statement is c, sz, err := t.br.ReadRune(). It looks like it blocks on ReadRune() until there is some data being written to the pty by the terminal application that was invoked.

Thanks for looking at it!

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@niten94
Comment options

@fswarbrick
Comment options

Answer selected by fswarbrick
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants