From 8823bef7c1db8f53c024fad0e48f52b2204addc0 Mon Sep 17 00:00:00 2001 From: a-kenji Date: Wed, 21 Apr 2021 15:26:05 +0200 Subject: [PATCH] Add ZELLIJ Environment Varable on startup(#304) Makes it easy and flexible to check whether zellij is already running. This carries no further information for now and is initialised to `0`. closes 304. --- src/common/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/common/mod.rs b/src/common/mod.rs index e2cd2220..1a26e108 100644 --- a/src/common/mod.rs +++ b/src/common/mod.rs @@ -16,6 +16,7 @@ use std::thread; use std::{collections::HashMap, fs}; use std::{ collections::HashSet, + env, io::Write, str::FromStr, sync::{Arc, Mutex}, @@ -128,6 +129,8 @@ pub fn start(mut os_input: Box, opts: CliArgs) { .write(take_snapshot.as_bytes()) .unwrap(); + env::set_var(&"ZELLIJ", "0"); + let config = Config::from_cli_config(opts.config, opts.option) .map_err(|e| { eprintln!("There was an error in the config file:\n{}", e);