From 337693dba6d7fb9da5e3564d1149841681d265d3 Mon Sep 17 00:00:00 2001 From: DmitryAstafyev Date: Wed, 18 Oct 2023 17:19:19 +0200 Subject: [PATCH] Correct parsing of /etc/shells --- src/profiles/unix.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/profiles/unix.rs b/src/profiles/unix.rs index 8bfef0f..0201709 100644 --- a/src/profiles/unix.rs +++ b/src/profiles/unix.rs @@ -12,9 +12,18 @@ pub(crate) fn get() -> Result, Error> { for shell in read_to_string(shells_file_path) .map_err(Error::Io)? .split('\n') + .filter(|s| !s.starts_with('#') && !s.is_empty()) { let path = Path::new(shell); - let profile = match Profile::new(&path.to_path_buf(), vec!["-c"], None) { + let profile = match Profile::new( + &path.to_path_buf(), + if path.ends_with("tcsh") || path.ends_with("csh") { + vec!["-c"] + } else { + vec!["-l", "-c"] + }, + None, + ) { Ok(profile) => profile, Err(err) => { log::warn!("Cannot get envvars for {shell}: {err}");