moo.shell.tests.test_session_commands
Tests for shell-layer session control features.
Covers: - TERM detection in MooPromptToolkitSSHSession.session_started() - Session setting registry updates via process_messages() - Global output prefix/suffix wrapping in handle_command() and process_messages() - .flush / _drain_messages()
Functions
_drain_messages() applies session_setting events it encounters while draining. |
|
_drain_messages() returns each plain text message in the queue. |
|
|
_editor_rejection_pieces wraps the message with [ERROR] when prefixes_mode is True. |
|
_editor_rejection_pieces does NOT add [ERROR] when prefixes_mode is False (default). |
process_commands() routes '.flush' to _drain_messages, not handle_command. |
|
handle_command() wraps output with output_global_prefix and output_global_suffix. |
|
When PREFIX/SUFFIX and global markers are both set, global markers are outermost. |
|
handle_command() omits OSC 133 wrappers when osc133_mode is False. |
|
handle_command() emits OSC 133;D;1 when parse_command reports exit_status=1. |
|
handle_command() prepends OSC 133;C and appends ;D;0 when osc133 is on (default). |
|
The osc133 accessor defaults to True when no setting is recorded. |
|
The osc133 accessor honours an explicit False setting. |
|
process_messages() wraps a plain text message with output_global_prefix/suffix. |
|
_repl_setup must open the session buffer, fire confunc, and signal process_messages that startup has finished. |
|
process_messages() stores a session_setting event in _session_settings. |
|
A vanilla terminal type produces a rich session with CPR untouched. |
|
|
The retired moo-automation TERM is treated as any other unknown terminal. |
session_started() with _chan=None does not crash. |
|
Regression: |
|
writer() with a _RawAnsi argument writes the raw bytes to the channel without LF translation. |