mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 06:15:54 +08:00
open: Don't run xdg-open in the background
This was introduced as a workaround to #7215 - xdg-open's generic path wouldn't background graphical apps. This has been fixed a month ago in xdg-open, so we can stop doing it. The good news is this also allows terminal apps to be used again, so it Fixes #10045
This commit is contained in:
parent
4ab34f2e86
commit
f8e38819a5
|
@ -24,14 +24,7 @@ if not command -sq open
|
|||
end
|
||||
else if type -q -f xdg-open
|
||||
for i in $argv
|
||||
# In the "generic" path where it doesn't use a helper utility,
|
||||
# xdg-open fails to fork off, so it blocks the terminal.
|
||||
xdg-open $i &
|
||||
# Note: We *need* to pass $last_pid, or it will disown the last *existing* job.
|
||||
# In case xdg-open forks, that would be whatever else the user has backgrounded.
|
||||
#
|
||||
# Yes, this has a (hopefully theoretical) race of the PID being recycled.
|
||||
disown $last_pid 2>/dev/null
|
||||
xdg-open $i
|
||||
end
|
||||
else
|
||||
echo (_ 'No open utility found. Try installing "xdg-open" or "xdg-utils".') >&2
|
||||
|
|
Loading…
Reference in New Issue
Block a user