Skip to content

Commit

Permalink
Minor cleanup of long command condition
Browse files Browse the repository at this point in the history
  • Loading branch information
tfpf committed Nov 3, 2024
1 parent 8ea1b50 commit 907063c
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions custom-prompt/custom-prompt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 907063c

Please sign in to comment.