diff options
author | Kirill Bulatov <mail4score@gmail.com> | 2024-03-18 03:15:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-18 01:15:39 +0000 |
commit | fe88aaa0855283d689dc41d531db916404ef9c51 (patch) | |
tree | ac70edbdeefdf4762ced6f57921a9569052d482e /alacritty | |
parent | 14b53f18dbae3f434a5011a9fb49b52574caedaf (diff) |
Allow setting terminal env vars via PTY options
Closes #7778.
Diffstat (limited to 'alacritty')
-rw-r--r-- | alacritty/src/cli.rs | 2 | ||||
-rw-r--r-- | alacritty/src/config/ui_config.rs | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/alacritty/src/cli.rs b/alacritty/src/cli.rs index d5e24b4a..91ba2fd6 100644 --- a/alacritty/src/cli.rs +++ b/alacritty/src/cli.rs @@ -1,4 +1,5 @@ use std::cmp::max; +use std::collections::HashMap; use std::ops::{Deref, DerefMut}; use std::path::PathBuf; use std::rc::Rc; @@ -195,6 +196,7 @@ impl From<TerminalOptions> for PtyOptions { working_directory: options.working_directory.take(), shell: options.command().map(Into::into), hold: options.hold, + env: HashMap::new(), } } } diff --git a/alacritty/src/config/ui_config.rs b/alacritty/src/config/ui_config.rs index a4b6c2c5..580a3dad 100644 --- a/alacritty/src/config/ui_config.rs +++ b/alacritty/src/config/ui_config.rs @@ -167,7 +167,12 @@ impl UiConfig { /// Derive [`PtyOptions`] from the config. pub fn pty_config(&self) -> PtyOptions { let shell = self.shell.clone().map(Into::into); - PtyOptions { shell, working_directory: self.working_directory.clone(), hold: false } + PtyOptions { + shell, + working_directory: self.working_directory.clone(), + hold: false, + env: HashMap::new(), + } } /// Generate key bindings for all keyboard hints. |