Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds a new API, GetSpeed(), which allows us to retrieve the output baud rate (we assume output and input are the same I've never seen that not be the case). The main use for this is for applications like Tcell (GitHub.com/gdamore/tcell) -- we need the baud rate to calculate how many padding characters we should insert when allowing for padding-based delays as specified by terminfo.
The methods here are derived in part from my own tcell package, but adjusted for use here. This is one more area where the operating systems differ significantly.
This is one of a series of improvements I hope to contribute which will allow me to use this package from within tcell. (Further improvements will be code to get the window size via TIOCGWINSIZE, and some portability fixes, including changes to reduce the dependency upon cgo for some platforms.)