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

Interactive pForth does not work when run from MiniGW Bash #94

Open
MaxBarraclough opened this issue Mar 10, 2021 · 1 comment
Open
Milestone

Comments

@MaxBarraclough
Copy link
Contributor

I'm running Windows 10/AMD64. I compiled pForth using Visual Studio 2019.

I'm able to run pForth from PowerShell or from the old cmd terminal and interactive usage works fine, but if I try to run it from the MiniGW Bash terminal (the one that ships with Git for Windows), pForth doesn't behave as expected. It seems not to ever receive commands typed into the prompt. Pressing enter does not have the effect of submitting a line to pForth for processing.

For comparison, Gforth runs fine in all three terminals.

Perhaps related to the use of getchar?

@letoh
Copy link
Contributor

letoh commented Aug 18, 2021

I guess the _getch() from the visual c++ runtime doesn't work well in the mintty
https://github.com/philburk/pforth/blob/master/csrc/win32_console/pf_io_win32_console.c#L198

and I found if you press ctrl-c when the program is blocked, all the input before the ctrl-c will be sent to the shell. It seems that the program is waiting for the input from a source which is different from the standard input.

I also tried to build pforth with cygwin and run it from the mintty. It works, not perfectly though. The terminal attribute control still breaks in the mintty, so you will see all input showed twice and encounter the getchar issue. At last I tried the mintty that ships with cygwin, everything goes well.

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

3 participants