aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/stdio-commands.c
AgeCommit message (Collapse)AuthorFilesLines
2025-07-31implemented ^T command: allows typing by code and getting characters from ↵Robin Haberkorn1-1/+81
stdin or the user * n:^T always prints bytes (cf. :^A) * ^T without arguments returns a codepoint or byte from stdin. In interactive mode, this currentply places a cursor in the message line and waits for a keypress.
2025-07-28=/==/===: fixed detection of execution from the end of the command-lineRobin Haberkorn1-6/+29
In particular, fixes the test case `3<255=>` which would print only one number in interactive mode.
2025-07-26implemented the <T> (typeout) command for printing to the terminal from the ↵Robin Haberkorn1-0/+36
current buffer * refactored some code that is common with Xq into teco_get_range_args().
2025-07-26support <:^A> to force raw ANSI outputRobin Haberkorn1-3/+15
* ^A uses the default code page without colon, just like ^U/EU. This is usually UTF8, unless you run with --8bit. It would make just as little sense to inherit the codepage from the current document. * Ensures that code like `:^A^E<0xFF>^A` really outputs byte 0xFF. * DEC TECO doesn't have the colon modifier, but it has a colon modifier for ^T to enforce raw output. In SciTECO, the ^T vs. :^T distinction will also be between default codepage and ANSI. It makes sense because ^T should treat its numeric arguments like <I> for consistency.
2025-07-26support :=/:==/:=== commands: print number without trailing linefeedRobin Haberkorn1-19/+29
2025-07-26implemented the <^A> command for printing arbitrary stringsRobin Haberkorn1-4/+48
* Greatly improved usability as a scripting language. * The command is in DEC TECO, but in contrast to DEC TECO, we also support string building constructs in ^A. * Required some refactoring: As we want it to write everything verbatim to stdout, the per-interface method is now teco_interface_msg_literal() and it has to deal with unprintable characters. When displaying in the UI, we use teco_curses_format_str() and TecoGtkLabel functions/widgets to deal with possible control codes. * Numbers printed with `=` have to be written with a trailing linefeed, which would also be visible as a reverse "LF" in the UI. Not sure whether this is acceptable - the alternative would be to strip the strings before displaying them. * Messages written to stdout are also auto-flushed at the moment. In the future we might want to put flushing under control of the language. Perhaps :^A could inhibit the flushing.
2025-07-22refactored =/==/=== command into stdio-commands.cRobin Haberkorn1-0/+197
There will be a lot more commands for terminal/message input and output soon.