Unbuffer reading the port etc.#21
Merged
ishuah merged 4 commits intoishuah:masterfrom Feb 10, 2025
puhitaku:puhitaku/unbuffer
Merged
Unbuffer reading the port etc.#21ishuah merged 4 commits intoishuah:masterfrom puhitaku:puhitaku/unbuffer
ishuah merged 4 commits intoishuah:masterfrom
puhitaku:puhitaku/unbuffer
Conversation
Contributor
Author
|
Oops, I forgot to update the tests. I'll add commits soon ... |
Owner
|
Thank you for this improvement PR @puhitaku I'm reviewing, will get back to you in a bit. |
ishuah
approved these changes
Feb 10, 2025
| case Esc: | ||
| connect.Write([]byte{'\x1b'}) | ||
| case CtrlBackslash: | ||
| fmt.Print("bye!") |
| func (c *Connect) read() { | ||
| buf := make([]byte, 1) | ||
| for { | ||
| response, err := c.portReader.ReadBytes('\n') |
Owner
There was a problem hiding this comment.
A bufferless approach makes much more sense.
Owner
|
Approved and merged. Thank you! |
Owner
|
I will create a new release this week. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Hi, thanks for the nice tool!
I've found some things to improve for better bifrost, so I've made some commits here:
5fd6351 Run go mod tidy
e970ec5 Unbuffer reading the port for realtime interaction
bufiowas used to buffer the line and read the RX line-by-line.io.ReadFullwith a single byte buffer instead, so now bifrost can receive and display every single byte as soon as it's received.dd03a78 Farewell with a fresh line
\naround "bye!" so that I can take screenshots of the log intact, and the friendly farewell will be more visible to users 😉I hope these changes are ok for you! Thanks!