Skip to content

Commit 3c7312d

Browse files
author
Bruno Sutic
committed
Add cygwin support
1 parent 3d6057e commit 3c7312d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Force text files to have unix eols, so Windows/Cygwin does not break them
2+
*.* eol=lf

open.tmux

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ is_osx() {
2121
[ "$platform" == "Darwin" ]
2222
}
2323

24+
is_cygwin() {
25+
[[ "$(uname)" =~ CYGWIN ]]
26+
}
27+
2428
get_editor_from_the_env_var() {
2529
if [ -z $EDITOR ]; then
2630
# $EDITOR not set, fallback
@@ -45,6 +49,8 @@ search_command_generator() {
4549
generate_open_command() {
4650
if is_osx; then
4751
echo "$(command_generator "open")"
52+
elif is_cygwin; then
53+
echo "$(command_generator "cygstart")"
4854
elif command_exists "xdg-open"; then
4955
echo "$(command_generator "xdg-open")"
5056
else
@@ -57,6 +63,8 @@ generate_open_search_command() {
5763
local engine="$1"
5864
if is_osx; then
5965
echo "$(search_command_generator "open" "$engine")"
66+
elif is_cygwin; then
67+
echo "$(command_generator "cygstart")"
6068
elif command_exists "xdg-open"; then
6169
echo "$(search_command_generator "xdg-open" "$engine")"
6270
else

0 commit comments

Comments
 (0)