Skip to content

Print stdin hint when opencc reads interactively without -i#1069

Merged
BYVoid merged 1 commit intomasterfrom
copilot/evaluate-issue-1054
Mar 27, 2026
Merged

Print stdin hint when opencc reads interactively without -i#1069
BYVoid merged 1 commit intomasterfrom
copilot/evaluate-issue-1054

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 27, 2026

Without -i, opencc silently blocks on stdin — indistinguishable from a hang for interactive users, especially on Windows.

When stdin is a TTY, print a one-line hint to stderr before entering the read loop:

  • Windows (_isatty): Reading from standard input. Press Ctrl+Z then Enter to finish.
  • Unix/macOS (isatty): Reading from standard input. Press Ctrl+D to finish.

No behavioral change when stdin is a pipe or redirected file.

@frankslin frankslin marked this pull request as ready for review March 27, 2026 01:58
@BYVoid BYVoid merged commit 145057a into master Mar 27, 2026
31 of 33 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.

3 participants