Add an action to copy CWD path to clipboard #17187

Open
opened 2026-01-31 05:34:46 +00:00 by claunia · 3 comments
Owner

Originally created by @zadjii-msft on GitHub (Apr 8, 2022).

I think this is pretty self explanatory.
Similar concerns as the "Open in File Explorer" action, #12859.
Maybe there's a way to make the action do nothing if the active Terminal hasn't set one?

Also relevant: #3337, #5916

Originally created by @zadjii-msft on GitHub (Apr 8, 2022). I think this is pretty self explanatory. Similar concerns as the "Open in File Explorer" action, #12859. Maybe there's a way to make the action do nothing if the active Terminal hasn't set one? Also relevant: #3337, #5916
claunia added the Area-SettingsIssue-TaskProduct-Terminal labels 2026-01-31 05:34:46 +00:00
Author
Owner

@davidegiacometti commented on GitHub (Jul 9, 2022):

Hi @zadjii-msft
This works as expected with shell configured to update CWD, otherwise the copied path will be the profile starting directory.
Is it fine with the fallback to the starting directory? I Don't think there is an easy way to detect if shell is configured for path integration.

@davidegiacometti commented on GitHub (Jul 9, 2022): Hi @zadjii-msft This works as expected with [shell configured to update CWD](https://docs.microsoft.com/en-us/windows/terminal/tutorials/new-tab-same-directory), otherwise the copied path will be the profile starting directory. Is it fine with the fallback to the starting directory? I Don't think there is an easy way to detect if shell is configured for path integration.
Author
Owner

@zadjii-msft commented on GitHub (Jul 11, 2022):

Is it fine with the fallback to the starting directory

Honestly, yea. If the shell hasn't given us something usable, then let's just go with something rather than nothing at all.

<aside>
A showerthought I had was maybe we flash a TeachingTip with something like "hey you need to set up the shell to tell the Terminal the CWD", but that sounds like a lot of work (and would need a lot more refining). We'd need to track if the path was ever set by the client-side, we'd need to figure out what the messaging is, we'd have to plumb events up to the app layer and back down - that's not worth it.

@zadjii-msft commented on GitHub (Jul 11, 2022): > Is it fine with the fallback to the starting directory Honestly, yea. If the shell hasn't given us something usable, then let's just go with _something_ rather than nothing at all. \<aside> A showerthought I had was maybe we flash a TeachingTip with something like "hey you need to set up the shell to tell the Terminal the CWD", but that sounds like a lot of work (and would need a lot more refining). We'd need to track if the path was ever set by the client-side, we'd need to figure out what the messaging is, we'd have to plumb events up to the app layer and back down - that's not worth it.
Author
Owner

@davidegiacometti commented on GitHub (Jul 11, 2022):

Thank you @zadjii-msft for the clarification.
Can you assign this issue to me?

@davidegiacometti commented on GitHub (Jul 11, 2022): Thank you @zadjii-msft for the clarification. Can you assign this issue to me?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17187