Don't show diff on 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.
Should there be a configuration option for that?
Umm... Wouldn't this change affect the case where the output is empty? 🤔
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:
In subsequent calls the result is highlighted:
It looks okay, so I'm going to merge it into v0.3.16 and make it possible to specify it as an option.