terminal: trim command when matching command for smart execution and when smart execu...