Last active
August 29, 2015 14:14
-
-
Save pierreprinetti/c83b62fbb2dca9e45fee to your computer and use it in GitHub Desktop.
Cygwin "open with Window Explorer"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open () { if [ -z "$1" ]; then P="."; else P="$1"; fi; P=`cygpath -aw "$P"`; explorer "$P"; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sublime () { if [ -z "$1" ]; then /cygdrive/c/Program\ Files/Sublime\ Text\ 3/subl.exe; else P=`cygpath -aw "$1"`; /cygdrive/c/Program\ Files/Sublime\ Text\ 3/subl.exe "$P"; fi; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If I ever happen to work on a Windows machine again, I will want this line added to my Cygwin's
~/.bashrc
in order to launch the file manager with the specified path, or the system default application with the specified file.This function fixes the weird behaviour of the
explorer
(most likely /cygwin/c/Windows/explorer.exe) command with POSIX paths as~
($HOME),.
(current directory),../
(parent directory).