terminal icon indicating copy to clipboard operation
terminal copied to clipboard

Export Text when in Admin mode filename suggestion has invalid character ":"

Open restartedwill opened this issue 3 years ago • 5 comments
trafficstars

Windows Terminal version

1.14.1963.0

Windows build number

22000.795

Other Software

No response

Steps to reproduce

Open Windows Terminal (Admin). Have text in console window. Right click on tab and choose "Export Text".

Expected Behavior

Cleanse out the colon character and other invalid characters for filenames based on the tab name.

Actual Behavior

Observe filename provided has "Admin: " as the leading text, and on Windows, a colon is not valid in filenames.

restartedwill avatar Aug 03 '22 16:08 restartedwill

I mean, I guess why not? We'd probably accept this as a contribution

zadjii-msft avatar Aug 03 '22 16:08 zadjii-msft

If @restartedwill is not willing to work on this issue, I would try to tackle this, but I'll need guidance to identify what files need to be examined and edited

Eschivo avatar Aug 05 '22 10:08 Eschivo

Yes, I am not able to tackle this change; just raising awareness in the hopes another developer could pick it up.

From: EliaSchiavon @.> Sent: Friday, August 5, 2022 4:16 AM To: microsoft/terminal @.> Cc: Will DP @.>; Mention @.> Subject: Re: [microsoft/terminal] Export Text when in Admin mode filename suggestion has invalid character ":" (Issue #13664)

If @restartedwill https://github.com/restartedwill is not willing to work on this issue, I would try to tackle this, but I'll need guidance to identify what files need to be examined and edited

— Reply to this email directly, view it on GitHub https://github.com/microsoft/terminal/issues/13664#issuecomment-1206284826 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AGHJGH5IQU2AV24YK6GC7RLVXTSWTANCNFSM55POEZIA . You are receiving this because you were mentioned. https://github.com/notifications/beacon/AGHJGHZN5EOK47B4U2XGEITVXTSWTA5CNFSM55POEZIKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOI7THEGQ.gif Message ID: @.***>

restartedwill avatar Aug 05 '22 10:08 restartedwill

That'd be great! I'd start right here:

https://github.com/microsoft/terminal/blob/74cdffe9215740a2c783c2d1f393fd303286b2b5/src/cascadia/TerminalApp/TabManagement.cpp#L435-L436

That's the line where we set the proposed text. I don't think we have any existing helpers for trimming a string so that it's a viable filename - I'll leave that as an exercise for the reader 😉

zadjii-msft avatar Aug 05 '22 11:08 zadjii-msft

Ahah thank you! Started working on it, I will raise a PR in the next few days

Eschivo avatar Aug 05 '22 20:08 Eschivo

:tada:This issue was addressed in #13693, which has now been successfully released as Windows Terminal Preview v1.16.252.:tada:

Handy links:

ghost avatar Sep 13 '22 17:09 ghost

:tada:This issue was addressed in #13693, which has now been successfully released as Windows Terminal v1.15.2874.:tada:

Handy links:

ghost avatar Oct 18 '22 21:10 ghost