Hide a stale help50 button after a quiet failure - #197
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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._helplessnow 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:canaryand 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.shpasses.