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.
This commit is contained in:
a-kenji 2021-04-21 15:26:05 +02:00
parent 4863fb7b5e
commit 8823bef7c1

View File

@ -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<dyn OsApi>, 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);