Skip to content

fix: stop dashboard auto-exiting + theme key + debug log + settings file#16

Merged
crgeee merged 3 commits into
masterfrom
fix/dashboard-spurious-quit
Apr 26, 2026
Merged

fix: stop dashboard auto-exiting + theme key + debug log + settings file#16
crgeee merged 3 commits into
masterfrom
fix/dashboard-spurious-quit

Conversation

@crgeee

@crgeee crgeee commented Apr 26, 2026

Copy link
Copy Markdown
Owner

Summary

You hit two related issues:

  1. "Why does it auto exit sometimes" — spurious quits
  2. "This thing exits after 60s or something" — same root cause, just slower
  3. Plus: "How do you change the dark vs light mode? Is there a setting?"

Root cause of the auto-exit

read -rsn 1 -t N returns rc=1 on EOF. We were treating that as "user pressed Ctrl-D" → arm quit-pending. But bash's read returns rc=1 from any stdin issue: closed fd, terminal multiplexer churn, the gh extension wrapper doing something to stdin. Indistinguishable from a real Ctrl-D press.

After a long timeout, getting back-to-back EOFs would interpret as "two Ctrl-D presses → confirmed quit." That's the 60s-ish exit — two refresh cycles where stdin glitched.

Fix: drop Ctrl-D-as-quit entirely. EOF on read is now a no-op with a one-time hint:

(stdin glitch; use [q] or Esc to quit cleanly)

q and Esc both still quit reliably (Esc still requires double-press). Trade-off is honest: Ctrl-D detection in bash read isn't reliable enough to tie to a destructive action.

Theme settings

Three ways now, in priority order:

  1. [t] key in the dashboard cycles dark → neon → light → dark, persists automatically.
  2. gh runner-status theme {dark|light|neon|next} — CLI subcommand, persists.
  3. GH_RUNNER_STATUS_THEME=neon env var — wins over settings file (one-shot).

Settings file at ~/.config/gh-runner-status/settings (key=value), parsed safely (no source).

Debug log

GH_RUNNER_STATUS_DEBUG=1 gh runner-status
# events → ~/.local/state/gh-runner-status/debug.log

Logs key presses, EOF events, refresh cycles, theme cycles, dashboard entry/exit. Helps diagnose stuff like "why did it auto-exit again" — readable timestamped lines per event.

Test plan

  • All 86 bats tests pass on bash 5 + bash 3.2
  • shellcheck clean
  • Bash 3.2 portability lint clean (now scans completion file too)
  • Theme cycle smoke-tested (gh runner-status theme next)
  • Settings file persists across invocations
  • Debug log writes events when enabled
  • Dashboard no longer auto-exits — verify after merge by running gh runner-status and walking away for 5+ minutes

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings April 26, 2026 23:17

Copilot AI 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.

Pull request overview

This PR addresses spurious dashboard exits by treating read -t EOF as a no-op, and adds user-configurable theming plus optional debug logging to help diagnose interactive issues.

Changes:

  • Ignore read -t EOF in the dashboard loop (no longer used as a quit signal) and show a one-time hint when stdin appears unstable.
  • Add persistent theme support (settings file + theme subcommand + [t] hotkey in dashboard) with env var override.
  • Add opt-in debug event logging via GH_RUNNER_STATUS_DEBUG=1, and document theme/logging in the README.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.

File Description
gh-runner-status Adds settings persistence, theme subcommand/hotkey, debug logging, and changes dashboard EOF handling.
README.md Documents theme configuration options and debug logging usage.

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

Comment thread gh-runner-status
Comment thread gh-runner-status
Comment thread gh-runner-status Outdated
Comment thread gh-runner-status Outdated
Comment thread gh-runner-status Outdated
Comment thread gh-runner-status
Comment thread gh-runner-status Outdated
Comment thread gh-runner-status Outdated
@crgeee crgeee merged commit 191bab7 into master Apr 26, 2026
6 checks passed
@crgeee crgeee deleted the fix/dashboard-spurious-quit branch April 26, 2026 23: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.

2 participants