From 68ab42f17af652cbf398c63f997dcef7c5ec454d Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sun, 4 Oct 2020 14:19:06 -0700 Subject: [PATCH] remove daemonize option from the gui This is a mux only option --- wezterm/src/main.rs | 57 --------------------------------------------- 1 file changed, 57 deletions(-) diff --git a/wezterm/src/main.rs b/wezterm/src/main.rs index 4385efc6a..f2d1f50e8 100644 --- a/wezterm/src/main.rs +++ b/wezterm/src/main.rs @@ -91,10 +91,6 @@ struct StartCommand { #[structopt(long = "no-auto-connect")] no_auto_connect: bool, - /// Detach from the foreground and become a background process - #[structopt(long = "daemonize")] - daemonize: bool, - /// Specify the current working directory for the initially /// spawned program #[structopt(long = "cwd", parse(from_os_str))] @@ -486,59 +482,6 @@ async fn async_run_terminal_gui( } fn run_terminal_gui(config: config::ConfigHandle, opts: StartCommand) -> anyhow::Result<()> { - #[cfg(unix)] - { - if opts.daemonize { - let stdout = config.daemon_options.open_stdout()?; - let stderr = config.daemon_options.open_stderr()?; - let mut daemonize = daemonize::Daemonize::new() - .stdout(stdout) - .stderr(stderr) - .working_directory(config::HOME_DIR.clone()); - - if !config::running_under_wsl() { - // pid file locking is only partly function when running under - // WSL 1; it is possible for the pid file to exist after a reboot - // and for attempts to open and lock it to fail when there are no - // other processes that might possibly hold a lock on it. - // So, we only use a pid file when not under WSL. - daemonize = daemonize.pid_file(config.daemon_options.pid_file()); - } - if let Err(err) = daemonize.start() { - use daemonize::DaemonizeError; - match err { - DaemonizeError::OpenPidfile - | DaemonizeError::LockPidfile(_) - | DaemonizeError::ChownPidfile(_) - | DaemonizeError::WritePid => { - bail!("{} {}", err, config.daemon_options.pid_file().display()); - } - DaemonizeError::ChangeDirectory => { - bail!("{} {}", err, config::HOME_DIR.display()); - } - _ => return Err(err.into()), - } - } - - // Remove some environment variables that aren't super helpful or - // that are potentially misleading when we're starting up the - // server. - // We may potentially want to look into starting/registering - // a session of some kind here as well in the future. - for name in &[ - "OLDPWD", - "PWD", - "SHLVL", - "SSH_AUTH_SOCK", - "SSH_CLIENT", - "SSH_CONNECTION", - "_", - ] { - std::env::remove_var(name); - } - } - } - opts.font_locator .unwrap_or(config.font_locator) .set_default();