summaryrefslogtreecommitdiffstats
path: root/src/configs
diff options
context:
space:
mode:
authorMikoĊ‚aj Rosowski <49301780+rosowskimik@users.noreply.github.com>2021-02-20 14:40:49 +0000
committerGitHub <noreply@github.com>2021-02-20 15:40:49 +0100
commit37d3425d219fef5e9de60ef29295f1bb7b57e94b (patch)
tree4a6b0902ab5de74c75d2403b2b4ecb1f0075fb33 /src/configs
parentd52edaa66147c9ab1c582ce18fffd53cbceb058f (diff)
feat: create shell module (#2329)
* Add the shell module This module allows to quickly identify which shell is currently used, in case someone frequently switches between them. * Updated documentation with shell module. Co-authored-by: mro <mro@fedorabox.localdomain>
Diffstat (limited to 'src/configs')
-rw-r--r--src/configs/mod.rs1
-rw-r--r--src/configs/shell.rs30
-rw-r--r--src/configs/starship_root.rs1
3 files changed, 32 insertions, 0 deletions
diff --git a/src/configs/mod.rs b/src/configs/mod.rs
index 91d3b1061..1052a6736 100644
--- a/src/configs/mod.rs
+++ b/src/configs/mod.rs
@@ -42,6 +42,7 @@ pub mod purescript;
pub mod python;
pub mod ruby;
pub mod rust;
+pub mod shell;
pub mod shlvl;
pub mod singularity;
mod starship_root;
diff --git a/src/configs/shell.rs b/src/configs/shell.rs
new file mode 100644
index 000000000..24551df97
--- /dev/null
+++ b/src/configs/shell.rs
@@ -0,0 +1,30 @@
+use crate::config::{ModuleConfig, RootModuleConfig};
+
+use starship_module_config_derive::ModuleConfig;
+
+#[derive(Clone, ModuleConfig)]
+pub struct ShellConfig<'a> {
+ pub format: &'a str,
+ pub bash_indicator: &'a str,
+ pub fish_indicator: &'a str,
+ pub zsh_indicator: &'a str,
+ pub powershell_indicator: &'a str,
+ pub ion_indicator: &'a str,
+ pub elvish_indicator: &'a str,
+ pub disabled: bool,
+}
+
+impl<'a> RootModuleConfig<'a> for ShellConfig<'a> {
+ fn new() -> Self {
+ ShellConfig {
+ format: "$indicator ",
+ bash_indicator: "bsh",
+ fish_indicator: "fsh",
+ zsh_indicator: "zsh",
+ powershell_indicator: "psh",
+ ion_indicator: "ion",
+ elvish_indicator: "esh",
+ disabled: true,
+ }
+ }
+}
diff --git a/src/configs/starship_root.rs b/src/configs/starship_root.rs
index 0c9ccc8fe..a73f0229a 100644
--- a/src/configs/starship_root.rs
+++ b/src/configs/starship_root.rs
@@ -71,6 +71,7 @@ pub const PROMPT_ORDER: &[&str] = &[
"battery",
"time",
"status",
+ "shell",
"character",
];