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

no echo when user types (cross-compiled for MIPS big-endian running OpenWRT) #87

Closed
jpellegrini opened this issue Jan 6, 2021 · 2 comments

Comments

@jpellegrini
Copy link
Contributor

I have made an (unofficial) package of PForth for OpenWRT (see #86 ). PForth runs fine, but without echoing input when the user types (the line is echoed at once when I type return).
This is strange because I remember having seeing in the source that PForth flushes the output after each char (or am I wrong?)

@philburk
Copy link
Owner

pForth should definitely echo each character as it is typed. It seems like the Terminal is configured to cache output until a newline.

This might be worth a try in your terminal initialization code in sdTerminalInit in pf_io_posix.c:

setvbuf(stdout, nullptr, _IONBF, (size_t) 0);

You can also try:

ECHO ON

but I suspect it will not help.

@jpellegrini
Copy link
Contributor Author

Calling setvbuf fixes it! Thank you! 😃

Is this something you'd be changing in pforth? Because if not, I can keep a patch with my OpenWRT packages, no problem.

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

No branches or pull requests

2 participants