Skip to content
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

Icon does not appear if ls is piped with findstr in Windows Terminal with powershell. #97

Open
debajyoti1990 opened this issue Mar 11, 2023 · 1 comment

Comments

@debajyoti1990
Copy link

Let's say I have a python file named abc.py in a folder. If I do 'ls' it displays with python icon but if I have multiple python files in that folder and I need to pipe findstr with ls a '?' appears instead of python icon.

Is it expected behavior ?

@frivard-coveo
Copy link

Unfortunately yes, it is expected. I had a similar issue (with a different program): the reason is that findstr is a very old program from the MSDOS days; it has been kept for backwards compatibility for decades. But it does not really support Unicode. Internally the operating system translates from Unicode to the current user codepage, which has very limited knowledge of special characters. Findstr then outputs in that codepage, which is re-translated to Unicode by the operating system before being displayed but whatever terminal you have.

If you are using Powershell, your next-best option is to use Select-String..

If you are okay with an external program, I highly recommend using RipGrep. It is blazing fast and has lots of neat options. Can be installed from Winget using winget install BurntSushi.ripgrep.MSVC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants