-
Notifications
You must be signed in to change notification settings - Fork 84
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
Output is invisible when run under PowerShell Core #10
Comments
I see this also on Windows 10 using For example, I generate some functions names like this:
But screen is blank when piped to less:
I have always set Thank you for maintaining this software for Windows. |
I encountered this problem as well for Windows 10. If it's the same problem, I have a fix in the 'dev' branch of my fork (rivy/less). Once I finish testing it, I'll be merging that branch into master. It might be a workaround for you until this is resolved within this repository. |
Thanks @rivy, I'll try your dev branch. |
I just pushed the 'dev' branch to my fork's 'master' and tagged it as a point release (https://github.com/rivy/less/releases/tag/v530.2). It looks good to me for CMD or PowerShell, with both the default console host and Let me know if it fixes you're problem. |
@rivy, your fix checks whether the window foreground and background colors are set to the same color, and forces them to be different if so. But why would the colors be the same in the first place? I assume this isn't just a user error where someone deliberately set the colors to be the same. |
I believe it's a console bug for Windows 10. Unfortunately, I've not been able to hone in any further on the error. And since I'm not sure where it's really coming from or why, I haven't filed a bug report. I only noticed that it started happening after I upgraded from one Win10 version to another. And I'm not purposefully setting the foreground and background to the same color, 😄. Yes, the "fix" is really only a heuristic repair, but I think it's a benign change as I can't think of a reason why anyone would run |
I have not found a consistent way to reproduce this. I can often reproduce this using
followed by I can sometimes get back to normal using some combination of |
It's definitely a bug with with Windows 10 1903 conhost... It's easily reproduced in the legacy conhost.exe and wt.exe with powershell.exe and pwsh.exe. I can't seem to reproduce it with cmd.exe though. One thing I have noticed is if I do a clear screen first and then |
I've shared a build with my fix for this issue and another (24 bit color support not working correctly on Windows 10) here. |
Thanks @lzybkr! Your fix works great! |
@rivy - you probably want to pick up lzybkr@163de2d as well. My change improves on rivy/less@24f137a by working when you pass |
Thanks for the suggestion. I'll look at integrating a modification of the original commit. |
When executed within a PowerShell Core console (the open source version of PowerShell that runs on Windows, Linux, and MacOS X), less works properly except that the output is invisible. That is, the console area where the text should be displayed is blank, but it's clear (e.g., by navigating up and down using the j/k keys and the = key to see what section of the file is being displayed) that the program itself is behaving correctly in all other ways. This problem only occurs when running under PowerShell Core; it does not occur when running under Windows PowerShell. I have not tested this on PowerShell Core running on either Linux or MacOS.
The text was updated successfully, but these errors were encountered: