From 3bfc4c2808d7e3ea50fb84780b4c30140114b3b1 Mon Sep 17 00:00:00 2001 From: Kirill Chibisov Date: Mon, 23 May 2022 03:35:09 +0300 Subject: Don't inherit `--command` for `SpawnNewInstance` Fixes #6060. --- alacritty/src/event.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'alacritty/src') diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs index 9d6f843c..873e2a34 100644 --- a/alacritty/src/event.rs +++ b/alacritty/src/event.rs @@ -364,6 +364,11 @@ impl<'a, N: Notify + 'a, T: EventListener> input::ActionContext for ActionCon // Reuse the arguments passed to Alacritty for the new instance. #[allow(clippy::while_let_on_iterator)] while let Some(arg) = env_args.next() { + // New instances shouldn't inherit command. + if arg == "-e" || arg == "--command" { + break; + } + // On unix, the working directory of the foreground shell is used by `start_daemon`. #[cfg(not(windows))] if arg == "--working-directory" { -- cgit