From 698108ac8b23b124784b1fa3a8b7ce25f1624c93 Mon Sep 17 00:00:00 2001 From: Thorsten Ball Date: Fri, 26 Jan 2024 10:42:07 +0100 Subject: [PATCH] Setup env correctly after upgrading alacritty_terminal Co-Authored-By: Antonio --- crates/terminal/src/terminal.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/crates/terminal/src/terminal.rs b/crates/terminal/src/terminal.rs index fe9c789a09..be8dc9ed01 100644 --- a/crates/terminal/src/terminal.rs +++ b/crates/terminal/src/terminal.rs @@ -277,7 +277,7 @@ impl TerminalBuilder { pub fn new( working_directory: Option, shell: Shell, - mut env: HashMap, + env: HashMap, blink_settings: Option, alternate_scroll: AlternateScroll, window: AnyWindowHandle, @@ -300,17 +300,22 @@ impl TerminalBuilder { } }; + // First, setup Alacritty's env + setup_env(); + + // Then setup configured environment variables + for (key, value) in env { + std::env::set_var(key, value); + } //TODO: Properly set the current locale, - env.insert("LC_ALL".to_string(), "en_US.UTF-8".to_string()); - env.insert("ZED_TERM".to_string(), true.to_string()); + std::env::set_var("LC_ALL", "en_US.UTF-8"); + std::env::set_var("ZED_TERM", "true"); let config = Config { scrolling_history: 10000, ..Default::default() }; - setup_env(); - //Spawn a task so the Alacritty EventLoop can communicate with us in a view context //TODO: Remove with a bounded sender which can be dispatched on &self let (events_tx, events_rx) = unbounded();