Skip to content

v0.2.0

Choose a tag to compare

@CannibalVox CannibalVox released this 08 Dec 20:08
· 44 commits to main since this release
  • Heavily rewrote the printer. Some major changes:
    • TelOpt negotiations now take place synchronously on the printer goroutine, ensuring that changes to communication semantics that take place as a result of received messages will immediately apply to data received after those messages.
    • IncomingText and IncomingCommand hooks have been replaced with the PrinterOutput hook. The concept of "line rewriting" is gone from text output, and instead the printer simply outputs data by type. Commands, Text, Control Codes, Prompts, and Sequences are each output from the printer as their own PrinterOutput type. These types are guaranteed not to release partial data (for instance, only full sequences will be output, only complete utf-8 characters, etc.). Consumers can receive, identify, and reason about each of these types to decide what to do.
  • Major changes to TelnetKeyboard:
    • WritePromptHint no longer simply calls WriteCommand. Instead, prompts are queued alongside other text when the keyboard is locked, and the decision of what command to be sent (if any) is not made until just before writing to the output stream, in order to ensure SUPPRESS-GO-AHEAD/EOR changes made after queuing a prompt are respected.
    • WriteCommand now accepts a post-write function to be executed immediately after writing a command to the output stream. This is useful for cases when the command is announcing a change in communication semantics to the remote. In such a case, communications changes should immediately take effect for subsequent writes, and the post-write function will ensure that that happens. All telopts have been updated to take advantage of this functionality.
  • Major changes to Charset:
    • Charset now has separate decoding & encoding negotiated charsets that need to be set separately and can be reasoned about separately. The CHARSET telopt handles setting these two charsets. This was necessary, because a correct implementation of CHARSET will update the decoding charset as soon as the command is received from the remote but not update the encoding charset until immediately after the acceptance command is sent.
    • Charset now has the concept of a fallback charset which is used for decoding when the current default/negotiated charset fails. This has been piped through to the printer and fallback decoding is fully working. The fallback charset name can be set in the TerminalConfig object. It can be left blank, resulting in no fallback functionality.
  • TelnetScanner added:
    • Most consumers have no use for this, but TelnetScanner is a type that can be used with any io.Reader to read telnet data into the same PrinterOutput types output by the Terminal's PrinterOutput hook. Some consumers interested in their own use cases and not interested in using Terminal may find this helpful.