Restore stdin to a proper terminal before calling nano