SamCoVT / TaliForth2

A Subroutine Threaded Code (STC) ANSI-like Forth for the 65c02
Other
29 stars 5 forks source link

fix piped input for c65 on native windows which breaks test framework #129

Open patricksurry opened 1 month ago

patricksurry commented 1 month ago

c65 currently reads input via kbit on native windows. this works interactively but fails if you try to redirect input from a pipe since it still waits for physical keyboard input.

should either remove kbhit and use blocking input (which would mean no KEY? there) or switch to an alternative implementation that recognizes non-interactive input streams. Some possibilities were discussed in https://github.com/SamCoVT/TaliForth2/issues/126

(you can assign me this one)

SamCoVT commented 1 month ago

Perhaps just a command line argument to force input from stdin? I see -s is already used... maybe -p to make the input pipe friendly?

The Makefile might also get a looking at - when I was trying to test native MinGW vs Cygwin vs WSL, I got tripped up on the c65 executable being c65.exe (MinGW and Cygwin, I think) vs c65 (WSL). I'm not sure how difficult it would be to detect the platforms in the makefile and just use a variable for that target name (and also in the rule for ctest where you call it). If you're not interested in the Makefile business, let me know and I can take a look at that separately.