diff options
author | Joe Wilm <jwilm@users.noreply.github.com> | 2017-01-07 09:46:28 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-07 09:46:28 -0800 |
commit | 56773fe7e7cdc999a6731934286858e763f96fda (patch) | |
tree | 5dbd83068a3106b00c7122de5674c5a03b4cfcf3 /src/config.rs | |
parent | c6959de11b735c1610973ee625f52ff7e892abcc (diff) | |
parent | 962dd61348d788fa48a6554ff8a079537d67fc0a (diff) | |
download | alacritty-56773fe7e7cdc999a6731934286858e763f96fda.tar.gz alacritty-56773fe7e7cdc999a6731934286858e763f96fda.zip |
Merge pull request #138 from honza/master
Add "shell" option to config
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs index f36859c7..4511b227 100644 --- a/src/config.rs +++ b/src/config.rs @@ -196,6 +196,9 @@ pub struct Config { #[serde(default="default_mouse_bindings")] mouse_bindings: Vec<MouseBinding>, + /// Path to a shell program to run on startup + shell: Option<PathBuf>, + /// Path where config was loaded from config_path: Option<PathBuf>, } @@ -228,6 +231,7 @@ impl Default for Config { colors: Default::default(), key_bindings: Vec::new(), mouse_bindings: Vec::new(), + shell: None, config_path: None, } } @@ -879,6 +883,12 @@ impl Config { .map(|p| p.as_path()) } + pub fn shell(&self) -> Option<&Path> { + self.shell + .as_ref() + .map(PathBuf::as_path) + } + fn load_from<P: Into<PathBuf>>(path: P) -> Result<Config> { let path = path.into(); let raw = Config::read_file(path.as_path())?; |