Skip to content

Commit 8fbd29e

Browse files
authored
Merge pull request #8 from acomagu/fix-prevent-exit
Disown the background job not to prevent exit
2 parents 9ff5367 + 5b13199 commit 8fbd29e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

conf.d/__async_prompt.fish

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ and begin
6666

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

0 commit comments

Comments
 (0)