fix(windows): quote diff-pane argv so git receives the delta pager intact#49
Merged
Conversation
…tact 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why diffs still failed on Windows
#43's follow-up (f4ac7a4, shipped in v0.2.9) replaced the
sh -c '… | delta'pipe withgit -c "core.pager=delta --paging=always" diff …, which is correct — but on Windowsalacritty_terminalflattens PTY argv into a singleCreateProcesscommand line and only quotes arguments whenOptions::escape_argsis set. We left it at the defaultfalse, so the command line came out as:The pager spec split on its internal space, git rejected
--paging=alwaysas an unknown global option and exited instantly, andreap_exited_sessionsclosed the pane the same frame — the diff panel "opened" and auto-closed without rendering anything. Any file path containing a space would have split identically.Fix
Set
escape_args: truefor diff-pane sessions, whose argv is constructed in code and therefore carries logical arguments that must survive intact. Config-shell args fromalacritty.tomlstay raw (false), matching how upstream alacritty treats user-authored shell arguments on Windows.No behavior change on unix: the field is
#[cfg(windows)]-gated and unix PTYs exec a real argv.Testing
cargo check -p alacritreeandcargo fmtclean on Linux; the Windows-gated field matchesalacritty_terminal::tty::Optionsexactly (same pattern as its owntest_cmdline, which assertsescape_args: trueproducesecho "hello world").🤖 Generated with Claude Code