diff --git a/crates/nu-cli/src/data/config.rs b/crates/nu-cli/src/data/config.rs index 5bda300d14..fbd296f27d 100644 --- a/crates/nu-cli/src/data/config.rs +++ b/crates/nu-cli/src/data/config.rs @@ -65,7 +65,11 @@ pub fn read( Some(ref file) => file.clone(), }; - touch(&filename)?; + if !filename.exists() && touch(&filename).is_err() { + // If we can't create configs, let's just return an empty indexmap instead as we may be in + // a readonly environment + return Ok(IndexMap::new()); + } trace!("config file = {}", filename.display());