aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2022-05-23 03:35:09 +0300
committerGitHub <noreply@github.com>2022-05-23 03:35:09 +0300
commit3bfc4c2808d7e3ea50fb84780b4c30140114b3b1 (patch)
tree1d6211c329d804c4abbc7c584a1aa4afe8aee5a7
parentc10888b0f09970d5def03f81b109f262b6f0b015 (diff)
downloadalacritty-3bfc4c2808d7e3ea50fb84780b4c30140114b3b1.tar.gz
alacritty-3bfc4c2808d7e3ea50fb84780b4c30140114b3b1.zip
Don't inherit `--command` for `SpawnNewInstance`
Fixes #6060.
-rw-r--r--CHANGELOG.md1
-rw-r--r--alacritty/src/event.rs5
2 files changed, 6 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6cfd6688..29e3fe95 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -24,6 +24,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- The `--help` output was reworked with a new colorful syntax
- OSC 52 is now disabled on unfocused windows
+- `SpawnNewInstance` no longer inherits initial `--command`
### Fixed
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<T> 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" {