fix(history): close stdin for git processes by jay23606 · Pull Request #365 · goldbarth/chartula · GitHub
Skip to content

fix(history): close stdin for git processes - #365

Merged
goldbarth merged 3 commits into
goldbarth:mainfrom
jay23606:fix/close-git-stdin
Oct 12, 2026
Merged

goldbarth merged 3 commits into
goldbarth:mainfrom
jay23606:fix/close-git-stdin

Conversation

@jay23606

@jay23606 jay23606 commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Closes #348

  • Why: Git inherited the terminal input while its output was redirected, causing the .NET runtime to write its keypad application-mode sequence again after each git call.
  • Decision: Redirect and close standard input for git processes; clarify that redirected output stays clean while a terminal still receives one runtime sequence that --plain does not remove.

Verified:

  • dotnet restore Chartula.slnx --locked-mode
  • dotnet build Chartula.slnx -c Release -warnaserror
  • dotnet test Chartula.slnx -c Release (1082 passed)
  • git diff --check

dotnet format Chartula.slnx --verify-no-changes reports existing formatting and line-ending issues across the repository, including files untouched by this change.

Tests: dotnet test Chartula.slnx -c Release (1,082 passed in the last recorded run, before the maintainer-added regression test; the current branch has not been rerun locally because .NET SDK 10.0.111 is unavailable).

@jay23606
jay23606 requested a review from goldbarth as a code owner October 9, 2026 22:54
No git command a run calls reads stdin, so the redirect and the close looked removable, and the suite, which runs without a terminal, stayed green without them. A stand-in git now names its stdin and reads it to the end; the comments in GitCli say why both lines are there (#348).
…moves it

Keeps the guarantee for what Chartula itself writes in plain mode, no control characters and nothing beyond ASCII, which the help text still gives. Names the sequence, that it follows stdout and stdin rather than stderr, that CI and NO_COLOR leave it like --plain does, and that TERM=dumb removes it. One sentence per line (#348).
@goldbarth

Copy link
Copy Markdown
Owner

@goldbarth
goldbarth merged commit 25cd872 into goldbarth:main Oct 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A run writes a terminal mode sequence on a terminal even with --plain, and again after each git call

2 participants