Add support for clean Grain termination on pressing q and ENTER.