2

There's this question on SO:

https://stackoverflow.com/questions/9637601/open-cygwin-at-a-specific-folder

I want to do something opposite. When using terminal I want to right click and have context menu item "Open Explorer here" to open regular Windows explorer window with current location (pwd). Is there a way to add context menu item to cygwin terminal?

asked Apr 23, 2015 at 11:56

2 Answers 2

2

Ctrl + click doesn't work with my mintty, maybe I'm doing it wrong.

Anyway, I've learned some trick from Pragmatistic Guy and made small modification to accomplish what you want more elegently. I'll copy his solution here and all credits belongs to him.

  • To ensure this script only run under cygwin, you may add platform detection commands to your ~/.bashrc:

    if [[ "$OSTYPE" == "linux-gnu" ]]; then
     echo "Linux-gnu environment detected."
    elif [[ "$OSTYPE" == "cygwin" ]]; then
     echo "Cygwin environment detected."
     if [ -f "${HOME}/.bashrc.cygwin" ]; then
     source "${HOME}/.bashrc.cygwin"
     fi
    else
     echo "Unknown Platform"
    fi
    
  • Now add following script to ~/.bashrc.cygwin:

    function xpl {
     if [ "1ドル" = "" ]; then
     XPATH=. # Open current directory in default
     else
     XPATH=1ドル
     XPATH="$(cygpath -C ANSI -w "$XPATH")";
     fi
     explorer $XPATH
     }
    
  • You can now call xpl dir_name_or_file_name to make windows open directory/file with default program.

  • explorer.exe won't block your shell input, isn't that perfect?

answered Aug 18, 2015 at 15:02
2

It turns out you can use Ctrl + click on a path in mintty to do exactly that.

answered Apr 23, 2015 at 12:02

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.