Skip to content

fix: disable Windows console QuickEdit mode on startup - #115

Merged
hasansezertasan merged 6 commits into
mainfrom
bugfix/disable-console-quickedit
Oct 19, 2026
Merged

hasansezertasan merged 6 commits into
mainfrom
bugfix/disable-console-quickedit

Conversation

@hasansezertasan

Copy link
Copy Markdown
Member

Summary

  • Clears the console QuickEdit flag at startup (Windows only) so a stray click in the console window can no longer pause the service by blocking stdout writes.
  • No-op on non-Windows platforms and when not attached to a console.

Testing

  • Added unit tests for the non-Windows no-op and the Windows flag-clearing path (mocked ctypes).
  • pytest, pyrefly, zuban and mypy pass. Not verified on a real Windows console.

Note: this does not hide the console window; a windowless build would be a separate change.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T11:54:56.191563Z 5a60453 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Clicking inside the console window starts a text selection, which blocks
writes to stdout and silently freezes the service until a key is pressed.
Clear ENABLE_QUICK_EDIT_MODE at startup so a stray click cannot pause it.
@hasansezertasan
hasansezertasan force-pushed the bugfix/disable-console-quickedit branch from b3b701f to 25b916d Compare October 18, 2026 04:56
Treat INVALID_HANDLE_VALUE as 'no console', log and continue if the
Win32 calls raise OSError instead of aborting startup, and route the
croupier logger to ~/.croupier.log so the warning is persisted.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: de5f964628

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/croupier/main.py Outdated

@ysnbyzli ysnbyzli left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

SetConsoleMode returns zero on failure instead of raising, so the
failure went unnoticed and QuickEdit stayed enabled. Check the result
and raise OSError with the last error code so it is logged.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8cb3957970

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/croupier/main.py Outdated
Comment thread src/croupier/main.py Outdated
GetStdHandle returns the redirected file or pipe when stdin is
redirected, so open CONIN$ explicitly instead. The console input mode
is shared with the parent shell, so remember the original mode and
restore it via atexit.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: efe7976303

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/croupier/main.py Outdated
Once CONIN$ opened, a zero return from GetConsoleMode is an API failure
on an attached console, not a windowless process. Raise so it is logged.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2195482414

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/croupier/main.py Outdated
Sweep the helper against the full API contract instead of patching one
call at a time: failure returns of CreateFileW, GetConsoleMode,
SetConsoleMode and CloseHandle are all checked, and error reporting goes
through one helper. CreateFileW failures other than the no-console
errors now raise instead of being treated as windowless.
@hasansezertasan
hasansezertasan merged commit f850eee into main Oct 19, 2026
2 checks passed
@hasansezertasan
hasansezertasan deleted the bugfix/disable-console-quickedit branch October 19, 2026 11:57
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.

2 participants