-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding ANSI Support to File Properties #70
Comments
without testing it I think you need entry like this: https://github.com/nohwnd/Profiler/blob/main/Profiler/Profiler.Format.ps1xml#L15 in here https://github.com/nohwnd/Profiler/blob/main/Profiler/Profiler.Format.ps1xml#L330 To show it in the selfDuration view, and similar change in all the other views. @JustinGrote @fflaten any one of you has some experience with putting ansi into format files? I am especially interested in detecting if the console can handle ansi and not breaking the experience for people who don't use ansi enabled console. I know how to detect it (it's complicated), but I am not sure how to not repeat the check over and over. maybe static property on a class we export from Profiler? |
You can always just use a scriptblock to define a format property and it can call a static method in profiler for the implementation detail,. |
Formatting runs in global scope, so any public method/member should do. I'd avoid the ANSI-codes in the XML, if it even parses correctly. As an alternative to Justin's helper-method suggestion, PowerShell uses a hidden code property like Not sure how they hide it in PS /workspaces/Pester> (Get-TypeData System.IO.DirectoryInfo).Members.NameString | fl *
GetCodeReference : System.String NameString(System.Management.Automation.PSObject)
SetCodeReference :
IsHidden : False
Name : NameString |
Hi @nohwnd,
As we previously discussed, adding ANSI support to the file property would significantly enhance usability by allowing users to
Ctrl+Click
in the Windows Terminal to directly open files.I propose using a format like the following:
"`e]8;;$($_.FullName)`e\$($_.Name)`e]8;;`e\"
I attempted to modify the
format.ps1xml
file to implement this, but I ran into some challenges, as I'm still new to that area.I would appreciate any advice or suggestions on how to move forward with this enhancement.
Thank you!
The text was updated successfully, but these errors were encountered: