Skip to content

Commit fc4322e

Browse files
mathix420claude
andcommitted
fix(windows): quote diff-pane argv so git receives the delta pager intact
The previous Windows diff fix moved delta into git's pager (`-c core.pager=delta --paging=always`), but alacritty_terminal joins PTY argv into a single CreateProcess command line and only quotes arguments when `Options::escape_args` is set — and we left it at the default `false`. The pager spec split on its space, git rejected `--paging=always` as an unknown global option and exited immediately, and the reaper closed the pane before the error could render: the diff "opened" and vanished showing nothing. Any file path containing a space would split the same way. Enable `escape_args` for diff panes, whose argv is built in code. Config-shell args stay raw to match upstream alacritty's handling of user-authored shell arguments. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent f845041 commit fc4322e

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

alacritree/src/session.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,14 @@ impl Session {
306306
working_directory: working_directory.clone(),
307307
drain_on_exit: false,
308308
env: config.env.clone(),
309-
// `Options` has a Windows-only `escape_args` field; leaning on
310-
// `Default` keeps the literal compilable on every target.
311-
..Default::default()
309+
// Windows has no argv: alacritty_terminal joins these args into a
310+
// single CreateProcess command line, quoting them only when this
311+
// is set. Diff panes pass argv built in code, where an arg with a
312+
// space (delta's pager spec, file paths) must survive as one
313+
// argument; shell args from alacritty.toml stay raw to match
314+
// upstream alacritty.
315+
#[cfg(windows)]
316+
escape_args: matches!(kind, SessionKind::Diff { .. }),
312317
};
313318

314319
// alacritty routes OSC 7 / signals by this id, so each session needs its own.

0 commit comments

Comments
 (0)