From: Alexander Barton Date: Fri, 4 Feb 2022 22:06:56 +0000 (+0100) Subject: std_functions: Make open_command() work on Linux without X11 running X-Git-Url: https://arthur.ath.cx/gitweb/?a=commitdiff_plain;h=6d3426be471fdbd349fb59c3e2de8fcce5f56d29;p=ax-zsh.git std_functions: Make open_command() work on Linux without X11 running --- diff --git a/default_plugins/std_functions/std_functions.zshrc b/default_plugins/std_functions/std_functions.zshrc index e20122a..373ac11 100644 --- a/default_plugins/std_functions/std_functions.zshrc +++ b/default_plugins/std_functions/std_functions.zshrc @@ -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