IUTF8 Terminal Mode in Secure Shell (SSH)
Extracted elements (6)
SSH lacked any encoding for the widely-used IUTF8 terminal mode bit despite its broad implementation in terminal drivers; this document adds the missing opcode rather than leaving implementations to use out-of-band or vendor-specific signaling. The opcode value 42 was chosen to fit within the existing RFC 4254 uint32-argument range (1–159).
The client SHOULD transmit a value for the IUTF8 terminal mode if it knows about one, and the server MAY ignore it. This mirrors the behavior specified for all other encoded terminal modes in RFC 4254.
The IUTF8 terminal mode (opcode 42) indicates that terminal I/O uses UTF-8 character encoding, used in the SSH 'pty-req' channel request type. It is typically used by the kernel's terminal driver on the server to determine how many bytes of input constitute a single logical character during line editing.
RFC 8160 augments the IANA 'Pseudo-Terminal Encoded Terminal Modes' registry (originally defined in RFC 4254 Section 8) by adding opcode 42 with mnemonic IUTF8 and description 'Terminal input and output is assumed to be encoded in UTF-8.'
Terminal drivers that interpret the IUTF8 bit as enabling UTF-8-aware line-editing should carefully consider treatment of illegal sequences, overlong encodings, and redundant representations of composed characters, per the security considerations of RFC 3629 and the Unicode Standard.
Opcode 42 (IUTF8) is encoded in the SSH terminal modes encoding with a single uint32 argument following the opcode byte. The value 0 disables IUTF8 mode and the value 1 enables it, consistent with the encoding rule in RFC 4254 Section 8 that opcodes 1–159 carry a single uint32 argument.