Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't show diff on first command result #137

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sentinelt
Copy link

Currently command result is initialized as empty which means that the first diff shows everything as added. With this change the no changes are shown on the first command result.

Currently command result is initialized as empty which means
that the first diff shows everything as added. With this change
the no changes are shown on the first command result.
@sentinelt
Copy link
Author

Should there be a configuration option for that?

@blacknon
Copy link
Owner

Umm...
Wouldn't this change affect the case where the output is empty? 🤔

@sentinelt
Copy link
Author

sentinelt commented Jun 26, 2024

I don't think so. Just to make sure I created a test script that sometimes shows an empty result:

#!/bin/bash
if (( RANDOM % 2 == 0 )); then
    echo "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
    echo "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
    echo "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
    echo "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."
    echo "Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
fi

In diff mode the first time the command is called the result is not highlighted:
image
In subsequent calls the result is highlighted:
image

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.

None yet

2 participants