edit: Factor out {Setup Cleanup}Terminal
edit: Key.rune -> .Rune
edit: Make 0 a special rune for invalid key