diff options
author | Denis Isidoro <denisidoro@users.noreply.github.com> | 2021-04-12 08:07:45 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-12 08:07:45 -0300 |
commit | eb146fb3f71b9dafe138a14181d61788911aba0d (patch) | |
tree | 89385859a95da6d77393ffca80083ffc7d9a7124 | |
parent | 9095e376aaf2771fc4c41af65c56afbb14f21297 (diff) |
Fix behavior for fish shell (#498)
Fixes #496
-rw-r--r-- | src/actor.rs | 8 | ||||
-rw-r--r-- | src/shell.rs | 7 |
2 files changed, 3 insertions, 12 deletions
diff --git a/src/actor.rs b/src/actor.rs index 26132ec..d4467af 100644 --- a/src/actor.rs +++ b/src/actor.rs @@ -5,7 +5,7 @@ use crate::writer; use crate::finder::structures::{Opts as FinderOpts, SuggestionType}; use crate::finder::Finder; -use crate::shell::{BashSpawnError, IS_FISH}; +use crate::shell::BashSpawnError; use crate::structures::cheat::{Suggestion, VariableMap}; use crate::structures::config::Action; use crate::structures::config::Config; @@ -71,15 +71,13 @@ fn prompt_finder( let mut opts = FinderOpts { overrides: config.fzf_overrides_var.clone(), preview: Some(format!( - r#"{prefix}navi preview-var "$(cat <<NAVIEOF + r#"navi preview-var "$(cat <<NAVIEOF {{+}} NAVIEOF )" "$(cat <<NAVIEOF {{q}} NAVIEOF -)" "{name}"; {extra}{suffix}"#, - prefix = if *IS_FISH { "bash -c '" } else { "" }, - suffix = if *IS_FISH { "'" } else { "" }, +)" "{name}"; {extra}"#, name = variable_name, extra = extra_preview.clone().unwrap_or_default() )), diff --git a/src/shell.rs b/src/shell.rs index 4ffc25a..6071ae4 100644 --- a/src/shell.rs +++ b/src/shell.rs @@ -1,13 +1,6 @@ -use crate::env_var; use std::fmt::Debug; use thiserror::Error; -lazy_static! { - pub static ref IS_FISH: bool = env_var::get("SHELL") - .unwrap_or_else(|_| "".to_string()) - .contains(&"fish"); -} - #[derive(Debug)] pub enum Shell { Bash, |