584e0a6ef9ade95cf68dab4f2026d2bd5954fe33

Author
Marc Cornellà <marc.cornella@live.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

Use shwordsplit in open_command()

Diff

 1diff --git a/lib/functions.zsh b/lib/functions.zsh
 2index bbdbea5cb6cca394a1598d92225e2704f4622ecf..f9d4a9717d7dd303458f8359dfe5c3b41a393d8d 100644
 3--- a/lib/functions.zsh
 4+++ b/lib/functions.zsh
 5@@ -16,14 +16,17 @@ function take() {
 6 }
 7 
 8 function open_command() {
 9+  emulate -L zsh
10+  setopt shwordsplit
11+
12   local open_cmd
13 
14   # define the open command
15   case "$OSTYPE" in
16-    darwin*)  open_cmd="open" ;;
17-    cygwin*)  open_cmd="cygstart" ;;
18-    linux*)   open_cmd="xdg-open" ;;
19-    msys*)    open_cmd="start \"\"" ;;
20+    darwin*)  open_cmd='open' ;;
21+    cygwin*)  open_cmd='cygstart' ;;
22+    linux*)   open_cmd='xdg-open' ;;
23+    msys*)    open_cmd='start ""' ;;
24     *)        echo "Platform $OSTYPE not supported"
25               return 1
26               ;;
27@@ -33,7 +36,7 @@ function open_command() {
28   if [[ "$OSTYPE" == darwin* ]]; then
29     $open_cmd "$@" &>/dev/null
30   else
31-    nohup ${(z)open_cmd} "$@" &>/dev/null
32+    nohup $open_cmd "$@" &>/dev/null
33   fi
34 }
35