moo.shell.tests.test_server.test_session_started_switches_encoding_policy_for_mud_clients
- moo.shell.tests.test_server.test_session_started_switches_encoding_policy_for_mud_clients()
For MUD-client TERM, session_started flips the channel encoding to surrogate-escape UTF-8 so 0xFF IAC bytes round-trip cleanly. Vanilla SSH leaves the channel in default strict UTF-8.
Term-driven setup runs in session_started (not connection_made) because asyncssh sets the terminal type from the PTY request, which arrives after connection_made and before session_started.