mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-05 16:21:15 -03:00
Don't use open function if a command exists
Turns out this is also the case on Haiku. It also eliminates a fork. Closes #3487.
This commit is contained in:
@@ -9,6 +9,8 @@ open FILES...
|
|||||||
|
|
||||||
`open` opens a file in its default application, using the appropriate tool for the operating system. On GNU/Linux, this requires the common but optional `xdg-open` utility, from the `xdg-utils` package.
|
`open` opens a file in its default application, using the appropriate tool for the operating system. On GNU/Linux, this requires the common but optional `xdg-open` utility, from the `xdg-utils` package.
|
||||||
|
|
||||||
|
Note that this function will not be used if a command by this name exists (which is the case on macOS or Haiku).
|
||||||
|
|
||||||
|
|
||||||
\subsection open-example Example
|
\subsection open-example Example
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
# application for the file.
|
# application for the file.
|
||||||
#
|
#
|
||||||
|
|
||||||
if not test (uname) = Darwin
|
if not command -s open >/dev/null
|
||||||
function open --description "Open file in default application"
|
function open --description "Open file in default application"
|
||||||
if count $argv >/dev/null
|
if count $argv >/dev/null
|
||||||
switch $argv[1]
|
switch $argv[1]
|
||||||
|
|||||||
Reference in New Issue
Block a user