Customizing right-click context menu "open Windows terminal here" for Cygwin (and other) profile #18897

Closed
opened 2026-01-31 06:27:35 +00:00 by claunia · 6 comments
Owner

Originally created by @CC-Hsu on GitHub (Nov 14, 2022).

Description of the new feature/enhancement

Hi, Team,

Microsoft Terminal supports customizing profile and Cygwin is one of supported configuration.

However, currently right-click context menu "open Windows terminal here" (my environment: Windows10) does not work great with Cygwin since Cygwin recoginzes Unix-like path expression.

In Cygwin, one can execute cygpath -u "Windows Full Directory Path Name" to map to the corresponding representation, and cd $(cygpath -u 'Windows Full Directory Path Name') to open Cygwin in the desired directory.

As far as I know, one can adjust from RegEdit, but it requires in-depth knowledge about RegEdit and search for right config to edit.

So it would be helpful if Microsoft Terminal Can support customizing right-click context menu command, supporting passing full Windows directory path as variable for customized command.

Besides, I find there are some similar feature requests about WSL environment #12961, I guess similar trick may also works for WSL, too.

Proposed technical implementation details (optional)

Adding a new profile key/value for customizing "right-click context menu" action (in the following setting page screenshot), and provide some shortcut that represents directory path for substitute.
image

Best Regards.

Originally created by @CC-Hsu on GitHub (Nov 14, 2022). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> Hi, Team, Microsoft Terminal supports customizing profile and [Cygwin is one of supported configuration](https://learn.microsoft.com/en-us/windows/terminal/dynamic-profiles#cygwin). However, currently right-click context menu "open Windows terminal here" (my environment: Windows10) does not work great with Cygwin since Cygwin recoginzes Unix-like path expression. In Cygwin, one can execute `cygpath -u "Windows Full Directory Path Name"` to map to the corresponding representation, and `cd $(cygpath -u 'Windows Full Directory Path Name')` to open Cygwin in the desired directory. As far as I know, one can adjust from RegEdit, but it requires in-depth knowledge about RegEdit and search for right config to edit. So it would be helpful if Microsoft Terminal Can support customizing right-click context menu command, supporting passing full Windows directory path as variable for customized command. Besides, I find there are some similar feature requests about WSL environment [#12961](https://github.com/microsoft/terminal/issues/12961), I guess similar trick may also works for WSL, too. # Proposed technical implementation details (optional) <!-- A clear and concise description of what you want to happen. --> Adding a new profile key/value for customizing "right-click context menu" action (in the following setting page screenshot), and provide some shortcut that represents directory path for substitute. ![image](https://user-images.githubusercontent.com/8018872/201676899-6c768c3e-1b7e-41d9-acc9-44fb1e14b4fb.png) Best Regards.
claunia added the Help WantedArea-SettingsResolution-DuplicateProduct-Terminal labels 2026-01-31 06:27:35 +00:00
Author
Owner

@lhecker commented on GitHub (Nov 15, 2022):

Solving this issue seems closely related to solving #1772, right?

@lhecker commented on GitHub (Nov 15, 2022): Solving this issue seems closely related to solving #1772, right?
Author
Owner

@zadjii-msft commented on GitHub (Nov 15, 2022):

tbh I was gonna double check what bash --login -i does. That might always ignore the CWD it was started in. There might be some other flag to bash that might let it be a login shell, but also respect the CWD it was started in.

That was my first idea.

@zadjii-msft commented on GitHub (Nov 15, 2022): tbh I was gonna double check what `bash --login -i` does. That might always ignore the CWD it was started in. There might be some other flag to bash that might let it be a login shell, but also respect the CWD it was started in. That was my first idea.
Author
Owner
@zadjii-msft commented on GitHub (Nov 15, 2022): Case in point: * https://superuser.com/questions/345964/start-bash-shell-cygwin-with-correct-path-without-changing-directory * https://superuser.com/a/743579/1069381
Author
Owner

@CC-Hsu commented on GitHub (Nov 15, 2022):

Hi,

I explore RegEdit (inspired by this old post) and find that Cygwin itself provides another script /usr/bin/xhere (in its core package Chere) to start a Cygwin bash shell in specified directory, accepting the same argument %V as vanilla Powershell.
image
image

And it also displays a way that WSL open in specified path, which works similarly as git bash by providing --cd option.
image

In the above screenshot, it seems that it does not necessary to start a bash shell with --login -i option? But I am not quite sure about it. 😅

Best Regards.

@CC-Hsu commented on GitHub (Nov 15, 2022): Hi, I explore RegEdit ([inspired by this old post](https://windowsloop.com/add-open-windows-terminal-here-option-to-right-click-menu/)) and find that Cygwin itself provides another script `/usr/bin/xhere` (in [its core package Chere](https://cygwin.com/packages/summary/chere.html)) to start a Cygwin bash shell in specified directory, accepting the same argument `%V` as vanilla Powershell. ![image](https://user-images.githubusercontent.com/8018872/201952179-bd937117-8039-40ab-8145-d6556c1d87a0.png) ![image](https://user-images.githubusercontent.com/8018872/201952218-d13dc570-e032-4667-a565-9a984d81d7c6.png) And it also displays a way that WSL open in specified path, which [works similarly as git bash](https://stackoverflow.com/questions/19916670/how-do-i-launch-a-git-bash-window-with-particular-working-directory-using-a-scri) by providing `--cd` option. ![image](https://user-images.githubusercontent.com/8018872/201952729-41331ad7-528e-40de-b12d-2aecc2ef31e8.png) In the above screenshot, it seems that it does not necessary to start a `bash` shell with `--login -i` option? But I am not quite sure about it. 😅 Best Regards.
Author
Owner

@zadjii-msft commented on GitHub (Mar 16, 2023):

Thanks for the suggestion! This is actually already being tracked by another issue on our repo - please refer to #6111 for more discussion.

/dup #6111

@zadjii-msft commented on GitHub (Mar 16, 2023): Thanks for the suggestion! This is actually already being tracked by another issue on our repo - please refer to #6111 for more discussion. /dup #6111
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (Mar 16, 2023):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@microsoft-github-policy-service[bot] commented on GitHub (Mar 16, 2023): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#18897