Correctly remove shell command from tasks list after completing.