From c49d4a936553135f6326e91e62445a5e04186a80 Mon Sep 17 00:00:00 2001 From: Anders Rasmussen Date: Tue, 14 Feb 2017 13:22:59 +1100 Subject: Add TERM config entry --- src/config.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/config.rs') diff --git a/src/config.rs b/src/config.rs index fafb61c2..3be8e4c8 100644 --- a/src/config.rs +++ b/src/config.rs @@ -11,6 +11,7 @@ use std::path::{Path, PathBuf}; use std::str::FromStr; use std::sync::mpsc; use std::time::Duration; +use std::collections::HashMap; use ::Rgb; use font::Size; @@ -171,6 +172,10 @@ impl<'a> Shell<'a> { /// Top-level config type #[derive(Debug, Deserialize)] pub struct Config { + /// TERM env variable + #[serde(default)] + env: HashMap, + /// Initial dimensions #[serde(default)] dimensions: Dimensions, @@ -267,6 +272,7 @@ impl Default for Config { shell: None, config_path: None, visual_bell: Default::default(), + env: Default::default(), } } } @@ -998,6 +1004,10 @@ impl Config { self.shell.as_ref() } + pub fn env(&self) -> &HashMap { + &self.env + } + fn load_from>(path: P) -> Result { let path = path.into(); let raw = Config::read_file(path.as_path())?; -- cgit v1.2.3-54-g00ecf