allow configuring shell integration injection

This commit is contained in:
Mitchell Hashimoto
2023-07-06 18:04:12 -07:00
parent 18e43ddb3f
commit 8239f09d9d
3 changed files with 46 additions and 4 deletions

View File

@@ -197,10 +197,32 @@ pub const Config = struct {
/// Additional configuration files to read.
@"config-file": RepeatableString = .{},
// Confirms that a surface should be closed before closing it. This defaults
// to true. If set to false, surfaces will close without any confirmation.
/// Confirms that a surface should be closed before closing it. This defaults
/// to true. If set to false, surfaces will close without any confirmation.
@"confirm-close-surface": bool = true,
/// Whether to enable shell integration auto-injection or not. Shell
/// integration greatly enhances the terminal experience by enabling
/// a number of features:
///
/// * Working directory reporting so new tabs, splits inherit the
/// previous terminal's working directory.
/// * Prompt marking that enables the "scroll_to_prompt" keybinding.
/// * If you're sitting at a prompt, closing a terminal will not ask
/// for confirmation.
/// * Resizing the window with a complex prompt usually paints much
/// better.
///
/// Allowable values are:
///
/// * "none" - Do not do any automatic injection. You can still manually
/// configure your shell to enable the integration.
/// * "auto" - Detect the shell based on the filename.
/// * "fish", "zsh" - Use this specific shell injection scheme.
///
/// The default value is "auto".
@"shell-integration": ShellIntegration = .auto,
/// This is set by the CLI parser for deinit.
_arena: ?ArenaAllocator = null,
@@ -1209,6 +1231,13 @@ pub const Keybinds = struct {
}
};
pub const ShellIntegration = enum {
none,
auto,
fish,
zsh,
};
// Wasm API.
pub const Wasm = if (!builtin.target.isWasm()) struct {} else struct {
const wasm = @import("os/wasm.zig");