From e8a93987ff0a60d1c893e802a5719eae2b0b9696 Mon Sep 17 00:00:00 2001 From: Jon Parise Date: Sun, 15 Dec 2024 10:54:25 -0500 Subject: [PATCH] core: only disable forced shell integration This allows automatic shell detection (the default) to also apply to 'initial-command', which is consistent with how it applies to 'command'. --- src/Surface.zig | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Surface.zig b/src/Surface.zig index 1f62513d0..67422abb3 100644 --- a/src/Surface.zig +++ b/src/Surface.zig @@ -509,12 +509,16 @@ pub fn init( // The command we're going to execute is either 'initial-command' // (from -e or explicit configuration) or 'command' (our shell or - // explicit configuration). Shell integration is disabled when - // we're using 'initial-command'. + // explicit configuration). Forced shell integration is disabled + // when we're using 'initial-command'. const command: ?[]const u8, const shell_integration: configpkg.Config.ShellIntegration = config: { if (app.first) { if (config.@"initial-command") |initial_command| { - break :config .{ initial_command, .none }; + const shell_integration: configpkg.Config.ShellIntegration = switch (config.@"shell-integration") { + .detect => .detect, + else => .none, + }; + break :config .{ initial_command, shell_integration }; } } break :config .{ config.command, config.@"shell-integration" };