When the user presses arrow up, the click.getchar() returns b'\xe0'. This behavior is probably good, but I guess it should be documented (along with other special characters), since it's not a valid utf-8 value even though the terminal encoding is utf-8. (The naive click.getchar().decode('utf-8') would crash on this example with UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 in position 0: unexpected end of data.)
When the user presses arrow up, the
click.getchar()returns b'\xe0'. This behavior is probably good, but I guess it should be documented (along with other special characters), since it's not a valid utf-8 value even though the terminal encoding is utf-8. (The naiveclick.getchar().decode('utf-8')would crash on this example withUnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 in position 0: unexpected end of data.)