aboutsummaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
authorHonza Pokorny <honza@redhat.com>2017-01-06 22:06:45 -0400
committerHonza Pokorny <me@honza.ca>2017-01-06 22:07:35 -0400
commitea44427be3af0b400e08f598f35ad48e73bc60a1 (patch)
tree342b65b1cf8c53d73693c9ed6dfe0f2c94608ce2 /src/config.rs
parentc73295715629f33e687741769f3079536ed5e104 (diff)
downloadalacritty-ea44427be3af0b400e08f598f35ad48e73bc60a1.tar.gz
alacritty-ea44427be3af0b400e08f598f35ad48e73bc60a1.zip
Add "shell" option to config
This allows you to configure the shell to use when alacritty starts. cc: #122
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs
index 36f0c363..188042ed 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -196,6 +196,8 @@ pub struct Config {
#[serde(default="default_mouse_bindings")]
mouse_bindings: Vec<MouseBinding>,
+ shell: Option<PathBuf>,
+
/// Path where config was loaded from
config_path: Option<PathBuf>,
}
@@ -228,6 +230,7 @@ impl Default for Config {
colors: Default::default(),
key_bindings: Vec::new(),
mouse_bindings: Vec::new(),
+ shell: None,
config_path: None,
}
}
@@ -878,6 +881,12 @@ impl Config {
.map(|p| p.as_path())
}
+ pub fn shell(&self) -> Option<&Path> {
+ self.shell
+ .as_ref()
+ .map(|p| p.as_path())
+ }
+
fn load_from<P: Into<PathBuf>>(path: P) -> Result<Config> {
let path = path.into();
let raw = Config::read_file(path.as_path())?;