moo.shell.tests.test_prompt_io
Tests for the prompt’s outbound rendering and wire-format behaviour.
Covers _make_key_bindings, writer() in rich/raw modes, OSC 133 prompt markers, generate_prompt(), the IAC prompt-end marker (EOR/GA/no-op), and the “oob” route_event path.
Functions
The prompt is a single stable marker. |
|
The prompt does not change shape when the avatar has no location. |
|
_make_key_bindings() returns a KeyBindings with one binding per PROMPT_SHORTCUT entry. |
|
MUD-client (IAC-enabled) sessions skip OSC 133 wrapping — Mudlet doesn't parse OSC 133 and the BEL-terminated frames swallow the trailing IAC GA, breaking the mapper's prompt-line detection. |
|
Vanilla SSH sessions retain OSC 133 wrapping (the default). |
|
When the session is IAC-enabled but EOR was not negotiated, the prompt-end marker defaults to IAC GA — the MUD convention; Mudlet's mapper relies on it for prompt boundary detection. |
|
After a prompt render, IAC EOR goes to the channel when the client negotiated EOR. |
|
No IAC bytes are emitted when the session is not IAC-enabled. |
|
The "oob" event hands raw IAC bytes to |
|
Shortcut handler places the cursor at the end of the text when the template contains no %. |
|
Shortcut handler replaces the buffer with the template text and places the cursor at the % position. |
|
writer() in raw mode writes SGR escape sequences to the channel for styled markup. |
|
writer() bypasses print_formatted_text and writes directly to the SSH channel in raw mode. |
|
writer() passes rendered ANSI output to print_formatted_text in rich mode. |