Update ui.py

Only allow printable ascii chars for input.