monochromegane / the_platinum_searcher

A code search tool similar to ack and the_silver_searcher(ag). It supports multi platforms and multi encodings.
MIT License
2.81k stars 141 forks source link

If PATH were to be not, program doesn't work.(on windows) #199

Open etilltwice opened 5 years ago

etilltwice commented 5 years ago

When I commit above command, I got no answer.

PS C:\Users\twice\Desktop\XXX> pt http

But I were to commit under command, it work without problem.

PS C:\Users\twice\Desktop\XXX> pt html ./
./\html\game.html
1:<!DOCTYPE html>
2:<html lang="en">
97:</html>

./\html\index.html
1:<!DOCTYPE html>
2:<html>
19:</html>

development environment

OS:windows 10 Home version: 1803 software: visual studio code (power shell)

monochromegane commented 5 years ago

Thanks! Would you teach pt version to me?

monochromegane commented 5 years ago

Can I try pt html not pt http ? I think your directory dose not contain http keyword .

etilltwice commented 5 years ago

I'm sorry not to commit same code. And, I forgot to tell the version. It doesn't work when commit same code.

PS C:\Users\twice\Desktop\XXX> pt html

the_platinum_searcher version: 2. 2. 0

monochromegane commented 5 years ago

Nice information. And... could you try the following command?

$ pt html .

Windows dose not represent . as current directory? If so that, pt ought to replace .. to ./.

etilltwice commented 5 years ago

I would be happy to. It seems that it works without error.

PS C:\Users\twice\Desktop\XXX> pt html .
.\html\game.html
1:<!DOCTYPE html>
2:<html lang="en">
97:</html>

.\html\index.html
1:<!DOCTYPE html>
2:<html>
19:</html>
monochromegane commented 5 years ago

Hmm... Please take time. I don't have Windows environment. I consider this another day.

monochromegane commented 5 years ago

Hi, if you have command prompt (DOS), could you try pt html in the environment?

ocitrev commented 5 years ago

The function givenStdin has a special case for Windows when it should not. Removing the OS check fixes the bug.

arijoon commented 4 years ago

This issue still persists, although I don't think it's neccesarily an issue, specifying path shouldn't be a problem. Can you please add it to the README.md? Just a simple note under windows that for windows users PATH option is required.

I installed from github