]> arthur.barton.de Git - ax-zsh.git/blobdiff - default_plugins/std_functions/std_functions.zshrc
std_functions: Make open_command() work on Linux without X11 running
[ax-zsh.git] / default_plugins / std_functions / std_functions.zshrc
index e20122ac80520675f0f1dfeb2c7e53de4349f055..373ac11b30b278ab2aa553b629f315471279bac8 100644 (file)
@@ -10,7 +10,12 @@ function open_command() {
                        cygstart "$@" || return 1
                        ;;
                linux*)
-                       nohup xdg-open "$@" &>/dev/null || return 1
+                       if [[ -n "$DISPLAY" ]]; then
+                               # X11
+                               nohup xdg-open "$@" &>/dev/null || return 1
+                       else
+                               xdg-open "$@" || return 1
+                       fi
                        ;;
                *)
                        return 2