From 6d3426be471fdbd349fb59c3e2de8fcce5f56d29 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Fri, 4 Feb 2022 23:06:56 +0100 Subject: [PATCH] std_functions: Make open_command() work on Linux without X11 running --- default_plugins/std_functions/std_functions.zshrc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- 2.39.2