Skip to content

Hide a stale help50 button after a quiet failure - #197

Merged
rongxin-liu merged 1 commit into
canaryfrom
help50-hide-stale
Sep 21, 2026
Merged

rongxin-liu merged 1 commit into
canaryfrom
help50-hide-stale

Conversation

@rongxin-liu

Copy link
Copy Markdown
Contributor

Follow-up to #196, from testing on the canary codespace.

Only a successful command hid the help50 button. A later failure with no output (grep zzz adieu.py, exit 1) left a button whose message belonged to an earlier command. _helpless now hides any pending button when there is nothing to show, sharing the logic with _helped, so the button always refers to the last command: each completed command either replaces it or clears it.

Related: cs50/cli#245 fixes the other half of what was observed, where tab-completion echo was mistaken for command output and produced a button for a command with no output. That fix reaches codespaces once it is in cs50/cli:canary and this image is rebuilt.

Verified under a pty with a fake command50: real error -> showButton; quiet failure -> hideButton; real error -> showButton; history-recalled quiet failure -> hideButton; success -> hideButton. tests/smoke.sh passes.

Only a successful command hid the button, so a later failure with no output
(e.g., grep with no match) left a button about an earlier command. Now any
completed command either replaces the button or clears it.
@rongxin-liu rongxin-liu self-assigned this Sep 21, 2026
@rongxin-liu
rongxin-liu merged commit 1fc9fea into canary Sep 21, 2026
1 check passed
@rongxin-liu
rongxin-liu deleted the help50-hide-stale branch September 21, 2026 05: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.

1 participant