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

[maiko] DSPBOUT, (CHARCODE EOL) - better handling of output to the "BCPL display" #1920

Closed
nbriggs opened this issue Dec 17, 2024 · 2 comments · Fixed by Interlisp/maiko#522

Comments

@nbriggs
Copy link
Contributor

nbriggs commented Dec 17, 2024

I happened to be looking in Maiko's dspsubrs.c, and discovered that there's a DSPBOUT subr, which is responsible for putting out a single character to the (implicitly specified) "BCPL display" stream - that's where those odd strings come from during the loadup process. The BCPL display (aka \TERM.OFD and *STANDARD-OUTPUT* before the window system comes up) in Maiko is bound to Unix stdout. The Lisp code that uses this is mostly in ATERM (e.g., SIMPLEPRINT).

As is to be expected, the Lisp code believes that you end a line with (CHARCODE EOL) - i.e. (CHARCODE CR). This is why the "lines" of output overprint in the loadup process. It's also the case that Maiko never explicitly flushes stdout - so one may well never see the output.

While it might have been nice to have replaced the value of (CHARCODE EOL) (as stored on CHARACTERNAMES -- who knew that (CHARCODE INFINITY) => 8551 ?!) with LF back in the day, I think the best thing to do in the DSPBOUT subr is (a) notice, in Maiko, character 13 being printed and instead output a linefeed (on Unix - and I think even Windows, these days), and (b) flush the output - either on seeing the EOL, or, since it's really infrequently used call, on every character.

Opinions?

@masinter
Copy link
Member

If we made an FDEV for Unix stdout then it would have a BOUTFN which called DSPBOUT?
could we DRIBBLE to such a stream?

@nbriggs
Copy link
Contributor Author

nbriggs commented Dec 19, 2024

@masinter - no, it's lower level than that - it knows nothing about streams, it takes exactly one 7-bit character and sends it to stdout on each call. If you want a stream interface to stdout for dribbling, just open one -- I do this often. I also dribble to "{unix}/tmp/dribble.txt" if it's big and I plan on saving it.

Screenshot 2024-12-18 at 10 59 32 PM
Screenshot 2024-12-18 at 11 00 13 PM

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 a pull request may close this issue.

2 participants