From 7a9df47e6c7d3bd7bd279cbd6d5b4d1bb41f43c4 Mon Sep 17 00:00:00 2001 From: Albin Date: Wed, 1 Jul 2015 11:33:54 -0500 Subject: [PATCH] Adding cygwin support Cygwin doesn't have xdg-open yet, so using cygstart is a common workaround for this (see http://www.dwheeler.com/essays/open-files-urls.html ), if this is accepted, adding windows support should be done equally, using "cmd /c start" instead of xdg-open. --- open.tmux | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/open.tmux b/open.tmux index 6e488ed..302c4a3 100755 --- a/open.tmux +++ b/open.tmux @@ -21,6 +21,11 @@ is_osx() { [ "$platform" == "Darwin" ] } +is_cygwin() { + local platform=$(uname) + [[ "$platform" =~ CYGWIN(.*) ]] +} + get_editor_from_the_env_var() { if [ -z $EDITOR ]; then # $EDITOR not set, fallback @@ -45,6 +50,8 @@ search_command_generator() { generate_open_command() { if is_osx; then echo "$(command_generator "open")" + elif is_cygwin; then + echo "$(command_generator "cygstart")" elif command_exists "xdg-open"; then echo "$(command_generator "xdg-open")" else