-
-
Notifications
You must be signed in to change notification settings - Fork 811
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
posh-git prompt makes PowerShell transcripts less readable #282
Comments
What version of Windows/PowerShell? My transcripts on PS 4.0 seem to always show |
Windows:
Powershell:
I'm using the following prompt replacement function, which I got from elsewhere in this repository. I'm thinking it's the standard thing to do, but maybe not:
|
Ooh, it might have something to do with ISE? Do you see the same behavior in a normal host? |
I do see similar behaviour:
|
The same thing happens for me, it looks like the transcript doesn't obey
Edit: It looks like each command's output is logged separately (which makes sense), so unless the number of |
I had noticed that. I guess it's really PowerShell's transcription logic that's broken, not posh-git. I'm intrigued that the > appears before the rest of the Write-Hosts. Somehow the return value of the prompt function is getting to the transcript before the strings that are being Write-Host-ed. |
Very curious. Unless we were to replace the multi- |
I agree. I poked at the [Host.UI] object a little and got nowhere. Someone wrote a wrapper for Write-Host that processes ANSI color, but I think that, even should you be able to return the entire prompt, with colours, as a single string with ANSI codes, even then one would have to change the function that prints the return value of the global prompt function to something that understands ANSI codes. I don't know enough about PowerShell / .NET to dig that deep. |
ANSI escape sequences are supported in the very latest Windows 10 insider builds (basically anything later than the November update). PowerShell 5.1 (not yet available outside of the latest Windows Insider builds) adds a new property you can test to see if ANSI escape sequences are supported: So you could write something like:
You can read more about which sequences are supported here: https://msdn.microsoft.com/en-us/library/windows/desktop/mt638032%28v=vs.85%29.aspx |
Completely forgot about this. ANSI support is in progress: #304 |
Not sure what to say about that one, @dahlbyk -- I mean, the escape sequences are in the log...
|
To clarify, by "something funky" I mean that the first and last lines with |
I'm going to go ahead and close this. ANSI support in 1.0 seems to improve the situation enough. |
With posh-git:
Without posh-git:
The text was updated successfully, but these errors were encountered: