Skip to content

Made brick, life and blackjack usable in sshd and ansipixels new/open callable more then once#206

Merged
ldemailly merged 5 commits intomainfrom
sshd_hooks2
Dec 23, 2025
Merged

Made brick, life and blackjack usable in sshd and ansipixels new/open callable more then once#206
ldemailly merged 5 commits intomainfrom
sshd_hooks2

Conversation

@ldemailly
Copy link
Copy Markdown
Member

@ldemailly ldemailly commented Nov 21, 2025

@codecov
Copy link
Copy Markdown

codecov bot commented Nov 21, 2025

Codecov Report

❌ Patch coverage is 4.76190% with 160 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.22%. Comparing base (16faa22) to head (376b65e).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
blackjack/cli/blackjack.go 10.66% 67 Missing ⚠️
blackjack/main.go 0.00% 54 Missing ⚠️
brick/cli/brick.go 0.00% 19 Missing ⚠️
ansipixels/ansipixels.go 0.00% 11 Missing ⚠️
life/cli/life.go 0.00% 5 Missing ⚠️
brick/main.go 0.00% 2 Missing ⚠️
life/main.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #206      +/-   ##
==========================================
- Coverage   17.31%   17.22%   -0.10%     
==========================================
  Files          23       26       +3     
  Lines        4308     4332      +24     
==========================================
  Hits          746      746              
- Misses       3531     3555      +24     
  Partials       31       31              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

ldemailly added a commit to fortio/sshdtui that referenced this pull request Nov 21, 2025
ldemailly added a commit to fortio/sshdtui that referenced this pull request Nov 21, 2025
* Run brick and life with updated sshd hooks in ansipixels

* Use current tag from fortio/terminal#206

* New repo name

* lint fix and text

* A few more logs of what action the user made
@ldemailly ldemailly changed the title Made brick and life usable in sshd and ansipixels new/open callable more then once Made brick, life and blackjack usable in sshd and ansipixels new/open callable more then once Nov 21, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the terminal games (life, brick, and blackjack) to make them usable within SSH server environments by extracting game logic into reusable cli packages. The changes also enhance ansipixels to support pre-configured terminal environments through a new SkipOpen flag and lazy Logger initialization.

Key Changes

  • Restructured games by moving main logic to cli sub-packages, allowing game code to be invoked from external contexts like SSH servers
  • Added SkipOpen flag and lazy Logger initialization in ansipixels to support pre-opened terminal environments
  • Made DetectColorModeEnv function public to allow custom environment variable providers

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
life/main.go New entry point that delegates to cli.Main()
life/cli/life.go Refactored from main package to cli, split into Main() for setup and RunGame() for game loop
brick/main.go New entry point that delegates to cli.Main()
brick/cli/brick.go Refactored from main package to cli, introduces BrickConfig struct and split Main()/Run() pattern
brick/cli/replay.go Changed package from main to cli
blackjack/main.go New entry point containing all setup logic and calling cli.Game.RunGame()
blackjack/cli/blackjack.go Refactored from main package to cli, exposes Game struct with public fields and RunGame() method
blackjack/cli/blackjack_test.go Updated package name and field references from private to public
ansipixels/ansipixels.go Added SkipOpen flag, DetectColorModeEnv function, and moved Logger initialization to Open() with nil check
Comments suppressed due to low confidence (1)

brick/cli/brick.go:377

  • [nitpick] The FPS field in BrickConfig is declared but never used. It's not set in Main() and not accessed in Run(). Consider removing it or setting it to *fpsFlag in Main() if it's intended for future use.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ldemailly ldemailly merged commit e90b272 into main Dec 23, 2025
16 of 18 checks passed
@ldemailly ldemailly deleted the sshd_hooks2 branch January 19, 2026 23:14
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