server_shell

Telnet server shell implementations.

async telnet_server_shell(reader, writer)[source]

A default telnet shell, appropriate for use with telnetlib3.create_server.

This shell provides a very simple REPL, allowing introspection and state toggling of the connected client session.

Return type:

None

async readline_async(reader, writer, max_visible_width=0)[source]

Async readline that filters ANSI escape sequences.

Uses filter_ansi() to strip escape sequences and _LineEditor for grapheme-aware backspace and max_visible_width support.

Return type:

Optional[str]

readline(_reader, writer, max_visible_width=0)[source]

Blocking readline using generator yield/send protocol.

Characters are fed in via send() and complete lines are yielded. Uses _LineEditor for grapheme-aware backspace and max_visible_width support.

Return type:

Generator[Optional[str], str, None]

get_linemode(writer)[source]

Display current LINEMODE negotiation state.

Return type:

str

get_slcdata(writer)[source]

Display Special Line Editing (SLC) characters.

Return type:

str

do_toggle(writer, option)[source]

Display or toggle telnet session parameters.

Return type:

str