fixed completion-history by escaping properly the sed command and also added filedir completion as fallback