diff options
author | Ken Matsui <26405363+ken-matsui@users.noreply.github.com> | 2021-11-10 17:02:17 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-10 09:02:17 +0100 |
commit | 6d60d83e5808d3ccc5073f9f92368f38b8f3ae41 (patch) | |
tree | 89d7c43cbdf7e71c6e6c11a20bf96379904e39a0 /zellij-client/src | |
parent | 03f58fc184bc1be47a8da526563e60a21a1fced0 (diff) |
fix(envs): Unify operation of Zellij environment variables (#842)
Diffstat (limited to 'zellij-client/src')
-rw-r--r-- | zellij-client/src/lib.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/zellij-client/src/lib.rs b/zellij-client/src/lib.rs index 45842fece..cbad733cb 100644 --- a/zellij-client/src/lib.rs +++ b/zellij-client/src/lib.rs @@ -18,7 +18,8 @@ use crate::{ use zellij_tile::data::InputMode; use zellij_utils::{ channels::{self, ChannelWithContext, SenderWithContext}, - consts::{SESSION_NAME, ZELLIJ_IPC_PIPE}, + consts::ZELLIJ_IPC_PIPE, + envs, errors::{ClientContext, ContextType, ErrorInstruction}, input::{actions::Action, config::Config, options::Options}, ipc::{ClientAttributes, ClientToServerMsg, ExitReason, ServerToClientMsg}, @@ -119,7 +120,7 @@ pub fn start_client( .get_stdout_writer() .write(clear_client_terminal_attributes.as_bytes()) .unwrap(); - std::env::set_var(&"ZELLIJ", "0"); + envs::set_zellij("0".to_string()); let palette = config.themes.clone().map_or_else( || os_input.load_palette(), @@ -137,14 +138,12 @@ pub fn start_client( let first_msg = match info { ClientInfo::Attach(name, config_options) => { - SESSION_NAME.set(name).unwrap(); - std::env::set_var(&"ZELLIJ_SESSION_NAME", SESSION_NAME.get().unwrap()); + envs::set_session_name(name); ClientToServerMsg::AttachClient(client_attributes, config_options) } ClientInfo::New(name) => { - SESSION_NAME.set(name).unwrap(); - std::env::set_var(&"ZELLIJ_SESSION_NAME", SESSION_NAME.get().unwrap()); + envs::set_session_name(name); spawn_server(&*ZELLIJ_IPC_PIPE).unwrap(); |