Issue #377 collapse button staying red

Basically it checks if the current command is not empty. If it's not then the command was actually executed, otherwise last_command is discarded