Add proper key grabbing, fixes xterm eating all input.
Currently a bit hacky, but I don't see a better way for it...