(encode_terminal_code): Adjusted for the change of