diff options
author | Robby Russell <robby@planetargon.com> | 2015-08-12 21:14:27 -0700 |
---|---|---|
committer | Robby Russell <robby@planetargon.com> | 2015-08-12 21:14:27 -0700 |
commit | b8dbd9bfba261cde572a9cd196dc057719862a6d (patch) | |
tree | 34887e6b187a29887dde97f113bc0a681df17267 /lib/functions.zsh | |
parent | 4c1eda114d982ff5f7f7adc396f24c25d3f639d0 (diff) | |
parent | b760a10cb27e5e17ad32e51ffac3374334fa4888 (diff) | |
download | zsh-b8dbd9bfba261cde572a9cd196dc057719862a6d.tar.gz zsh-b8dbd9bfba261cde572a9cd196dc057719862a6d.tar.bz2 zsh-b8dbd9bfba261cde572a9cd196dc057719862a6d.zip |
Merge pull request #4217 from mcornella/standard-open-command
Implement and use a standard, cross-platform open command
Diffstat (limited to 'lib/functions.zsh')
-rw-r--r-- | lib/functions.zsh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/functions.zsh b/lib/functions.zsh index 17f5f9cbf..0d632a268 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -15,6 +15,22 @@ function take() { cd $1 } +function open_command() { + local open_cmd + + # define the open command + case "$OSTYPE" in + darwin*) open_cmd="open" ;; + cygwin*) open_cmd="cygstart" ;; + linux*) open_cmd="xdg-open" ;; + *) echo "Platform $OSTYPE not supported" + return 1 + ;; + esac + + nohup $open_cmd "$@" &>/dev/null +} + # # Get the value of an alias. # |