private function discoverEditor() : string
    {
        $editor = getenv('EDITOR');

        if ($editor) {
            return $editor;
        }

        return isset($_SERVER['OS']) && false !== strpos($_SERVER['OS'], 'indows')
            ? 'notepad'
            : 'vi';
    }