Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use fish_postexec instead of fish_prompt #130

Merged
merged 1 commit into from
Sep 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions conf.d/done.fish
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ if set -q __done_enabled
set __done_initial_window_id (__done_get_focused_window_id)
end

function __done_ended --on-event fish_prompt
function __done_ended --on-event fish_postexec
set -l exit_status $status

# backwards compatibility for fish < v3.0
Expand All @@ -208,14 +208,14 @@ if set -q __done_enabled
if test $cmd_duration
and test $cmd_duration -gt $__done_min_cmd_duration # longer than notify_duration
and not __done_is_process_window_focused # process pane or window not focused
and not string match -qr $__done_exclude $history[1] # don't notify on git commands which might wait external editor
and not string match -qr $__done_exclude $argv[1] # don't notify on git commands which might wait external editor

# Store duration of last command
set -l humanized_duration (__done_humanize_duration "$cmd_duration")

set -l title "Done in $humanized_duration"
set -l wd (string replace --regex "^$HOME" "~" (pwd))
set -l message "$wd/ $history[1]"
set -l message "$wd/ $argv[1]"
set -l sender $__done_initial_window_id

if test $exit_status -ne 0
Expand Down