Skip to content

Take the console title helper from NosCore.Shared - #125

Merged
erwan-joly merged 1 commit into
masterfrom
chore/use-shared-console-helper
Aug 31, 2026
Merged

Take the console title helper from NosCore.Shared#125
erwan-joly merged 1 commit into
masterfrom
chore/use-shared-console-helper

Conversation

@erwan-joly

@erwan-joly erwan-joly commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

What

Program.cs carried try { Console.Title = Title; } catch (PlatformNotSupportedException) { } — guessing at a state the package can now answer. NosCore.Shared 6.0.2 ships ConsoleHelper, which asks whether this process owns a console before touching the title, so the line becomes ConsoleHelper.SetTitle(Title).

Worth knowing

That catch was aimed at the wrong exception. On a process with no console attached, Console.Title throws IOException, not PlatformNotSupportedException — measured:

GetConsoleWindow 0x0    raw Console.Title  THROWS IOException: The handle is invalid.

So it never caught anything here, and the injector would have died on the title line in a detached process just the same. The helper does not throw in the first place.

NosCore, NosCore.Injector and NosCore.ParserInputGenerator had each grown their own version of this; all three now take the package's.

Testing

  • Builds with 0 warnings against the published 6.0.2.
  • Not played in game — startup path only.

Summary by CodeRabbit

  • Bug Fixes
    • Improved application title handling for more consistent display across supported platforms.
    • Updated shared components to the latest maintenance release for improved stability and compatibility.

try { Console.Title = Title; } catch (PlatformNotSupportedException) { } was
guessing at a state the package can now answer: 6.0.2 ships ConsoleHelper,
which asks whether this process owns a console before touching the title.

The catch was also aimed at the wrong exception - the throw on a process
with no console attached is an IOException, so it never caught anything
here.

Tested: builds with 0 warnings.
@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 7cced7ed-0154-4f32-8d5e-243999260b89

📥 Commits

Reviewing files that changed from the base of the PR and between 59c5d21 and 576801c.

📒 Files selected for processing (2)
  • src/NosCore.Injector/NosCore.Injector.csproj
  • src/NosCore.Injector/Program.cs

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

NosCore.Injector updates NosCore.Shared to version 6.0.2 and uses ConsoleHelper.SetTitle(Title) instead of directly assigning Console.Title.

Changes

Console title update

Layer / File(s) Summary
Use the shared console title helper
src/NosCore.Injector/NosCore.Injector.csproj, src/NosCore.Injector/Program.cs
The project references NosCore.Shared version 6.0.2. Program.cs imports NosCore.Shared.Helpers and uses ConsoleHelper.SetTitle(Title).

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 57680

The change uses the shared console-title helper to prevent detached-process startup failures while preserving normal console behavior. No actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: using the console title helper from NosCore.Shared.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/use-shared-console-helper

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@erwan-joly
erwan-joly merged commit a93370e into master Aug 31, 2026
2 checks passed
@erwan-joly
erwan-joly deleted the chore/use-shared-console-helper branch August 31, 2026 09:30
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.

1 participant