From 907063ce99c98dbd42c590a41038aa0538cb2898 Mon Sep 17 00:00:00 2001 From: Vishal Pankaj Chandratreya <19171016+tfpf@users.noreply.github.com> Date: Sun, 3 Nov 2024 11:33:32 +0530 Subject: [PATCH] Minor cleanup of long command condition --- custom-prompt/custom-prompt.cc | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/custom-prompt/custom-prompt.cc b/custom-prompt/custom-prompt.cc index bbceaae..7149b35 100644 --- a/custom-prompt/custom-prompt.cc +++ b/custom-prompt/custom-prompt.cc @@ -581,15 +581,17 @@ void report_command_status(std::string_view& last_command, int exit_code, long l Interval interval(delay); write_report(last_command, exit_code, interval, columns); - if (delay > 10000000000ULL) + if (delay <= 10000000000ULL) { - long long unsigned curr_active_wid = get_active_wid(); - LOG_DEBUG("ID of focused window when command started was %llu.", prev_active_wid); - LOG_DEBUG("ID of focused window when command finished is %llu.", curr_active_wid); - if (prev_active_wid != curr_active_wid) - { - notify_desktop(last_command, exit_code, interval); - } + return; + } + + long long unsigned curr_active_wid = get_active_wid(); + LOG_DEBUG("ID of focused window when command started was %llu.", prev_active_wid); + LOG_DEBUG("ID of focused window when command finished is %llu.", curr_active_wid); + if (prev_active_wid != curr_active_wid) + { + notify_desktop(last_command, exit_code, interval); } }