Fix issue where failing to spawn a shell in a new terminal would break keyboard