Don't inherit `--command` for `SpawnNewInstance`

Fixes #6060.
This commit is contained in:
Kirill Chibisov 2022-05-23 03:35:09 +03:00 committed by GitHub
parent c10888b0f0
commit 3bfc4c2808
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -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

View File

@ -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" {