Skip to content

Commit

Permalink
Merge pull request #8 from acomagu/fix-prevent-exit
Browse files Browse the repository at this point in the history
Disown the background job not to prevent exit
  • Loading branch information
acomagu authored Apr 9, 2019
2 parents 9ff5367 + 5b13199 commit 8fbd29e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion conf.d/__async_prompt.fish
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ and begin

for func in (__async_prompt_config_functions)
__async_prompt_config_inherit_variables | __async_prompt_spawn $st 'set -l prompt ('$func'); and set -U __async_prompt_'$func'_text_'(__async_prompt_pid)' $prompt'
function '__async_prompt_'$func'_handler' --on-process-exit (jobs -lp | tail -n1)
set -l apid (jobs -lp | tail -n1)
disown $apid # Prevent blocking exit while job is running.
function '__async_prompt_'$func'_handler' --on-process-exit $apid
kill -WINCH (__async_prompt_pid)
sleep 0.1
kill -WINCH (__async_prompt_pid)
Expand Down

0 comments on commit 8fbd29e

Please sign in to comment.