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

Make sure terminal output is unbuffered on POSIX systems (probably related to musl, and not glibc) #110

Merged
merged 1 commit into from
Apr 4, 2022

Conversation

jpellegrini
Copy link
Contributor

Call setvbuf on terminal initialization in csrc/posix/pf_io_posix.c. At least on one platform (OpenWRT), pForth was buffering the characters while the user typed, instead of echoing them immediately; this fixes that issue.

Question: I did not check the output of setvbuf. Do you think it's necessary? I could change it so it issues a warning (to stderr, so the output is flushed immediately! 😁 )

@jpellegrini jpellegrini changed the title Make sure terminal output is unbuffered on POSIX systems Make sure terminal output is unbuffered on POSIX systems (probably related to musl, and not glibc) Mar 29, 2022
Copy link
Owner

@philburk philburk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need the call to tcsetattr()?
Do all posix systems support setvbuf()?

Call setvbuf on terminal initialization in
csrc/posix/pf_io_posix.c. At least on one platform (OpenWRT),
pForth was buffering the characters while the user typed,
instead of echoing them immediately; this fixes that issue.
@philburk
Copy link
Owner

philburk commented Apr 4, 2022

@jpellegrini - Thanks for testing removing the call to tcsetattr() in #109.
It does seem to still be needed.
And thanks for adding the setvbuf() call.

@philburk philburk closed this Apr 4, 2022
@philburk philburk reopened this Apr 4, 2022
@philburk philburk merged commit fa8de1f into philburk:master Apr 4, 2022
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

Successfully merging this pull request may close these issues.

2 participants