unitopia-de / webmud3

Webmud3: third generation of the UNItopia Webmud as open source project.
GNU General Public License v3.0
9 stars 3 forks source link

Implement Telnet TTYPE Option (Terminal Type) #126

Open mystiker opened 2 weeks ago

mystiker commented 2 weeks ago

Description: Implement support for the Telnet TTYPE (Terminal Type) option to allow the client to communicate its terminal type to the server. This option is mainly used to identify the "name" of the application providing the terminal.

Details:

  1. Option Code: 24

  2. Functionality:

    • Upon negotiation, the server will request the terminal type by sending a TTYPE SEND command.
    • The client should respond with a fixed terminal type value of "webmud3b" using IS, as per specification.
  3. Expected Workflow:

    • The client should recognize IAC DO TTYPE from the server and respond with IAC WILL TTYPE to agree on TTYPE usage.
    • When receiving IAC SB TTYPE SEND IAC SE, the client should respond with IAC SB TTYPE IS "webmud3b" IAC SE.
  4. Acceptance Criteria:

    • The client successfully responds with "webmud3b" as the terminal type when requested by the server.
    • The client handles repeated requests for terminal type correctly, as some servers may periodically re-request this information.

References:

Additional Notes: Ensure that the TTYPE negotiation process does not interfere with other negotiated options and that the client’s response timing aligns with the server’s request.

mystiker commented 1 day ago

I made the terminal type name ("webmud3b") configurable via an environment variable NAME. This will allow distinguishing between locally and remotely deployed clients, ensuring greater flexibility and adaptability in deployment scenarios.