mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 07:46:12 +03:00
Fix shell-integration-features
being ignored when shell-integration
is none
This commit is contained in:
@ -875,7 +875,11 @@ const Subprocess = struct {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const force: ?shell_integration.Shell = switch (cfg.shell_integration) {
|
const force: ?shell_integration.Shell = switch (cfg.shell_integration) {
|
||||||
.none => break :shell .{ null, default_shell_command },
|
.none => {
|
||||||
|
// Even if shell integration is none, we still want to set up the feature env vars
|
||||||
|
try shell_integration.setupFeatures(&env, cfg.shell_integration_features);
|
||||||
|
break :shell .{ null, default_shell_command };
|
||||||
|
},
|
||||||
.detect => null,
|
.detect => null,
|
||||||
.bash => .bash,
|
.bash => .bash,
|
||||||
.elvish => .elvish,
|
.elvish => .elvish,
|
||||||
|
@ -114,9 +114,7 @@ pub fn setup(
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Setup our feature env vars
|
// Setup our feature env vars
|
||||||
if (!features.cursor) try env.put("GHOSTTY_SHELL_INTEGRATION_NO_CURSOR", "1");
|
try setupFeatures(env, features);
|
||||||
if (!features.sudo) try env.put("GHOSTTY_SHELL_INTEGRATION_NO_SUDO", "1");
|
|
||||||
if (!features.title) try env.put("GHOSTTY_SHELL_INTEGRATION_NO_TITLE", "1");
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -138,6 +136,17 @@ test "force shell" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Setup shell integration feature environment variables without
|
||||||
|
/// performing full shell integration setup.
|
||||||
|
pub fn setupFeatures(
|
||||||
|
env: *EnvMap,
|
||||||
|
features: config.ShellIntegrationFeatures,
|
||||||
|
) !void {
|
||||||
|
if (!features.cursor) try env.put("GHOSTTY_SHELL_INTEGRATION_NO_CURSOR", "1");
|
||||||
|
if (!features.sudo) try env.put("GHOSTTY_SHELL_INTEGRATION_NO_SUDO", "1");
|
||||||
|
if (!features.title) try env.put("GHOSTTY_SHELL_INTEGRATION_NO_TITLE", "1");
|
||||||
|
}
|
||||||
|
|
||||||
/// Setup the bash automatic shell integration. This works by
|
/// Setup the bash automatic shell integration. This works by
|
||||||
/// starting bash in POSIX mode and using the ENV environment
|
/// starting bash in POSIX mode and using the ENV environment
|
||||||
/// variable to load our bash integration script. This prevents
|
/// variable to load our bash integration script. This prevents
|
||||||
|
Reference in New Issue
Block a user