dborzov / lsp

lsp is like ls command but more human-friendly
MIT License
529 stars 17 forks source link

list of files inaccurate #9

Open jerdmann opened 10 years ago

jerdmann commented 10 years ago

I'm seeing a weird behavior when running lsp. When I run lsp in pretty much any directory, the number of files is accurate but I'm seeing lots of repeated filenames. For example, in a given directory with 100 files, I see 100 files in the list but only one or two filenames, almost like a couple of the names "smear" over everything else.

Below is how to reproduce this problem. I'm running ubuntu 14.04 LTS x64 and I built lsp using go version xgcc (Ubuntu 4.9.1-0ubuntu1) 4.9.1 linux/amd64. I ran a simple 'go get ' like the README specifies.

Thanks for the awesome tool. Hopefully we can fix this. I'll take a look too but I have zero go programming experience. =)

To reproduce the problem:

  1. In some directory, create some files: for i in {1..20}; do touch file$i; done
  2. Run lsp and get this:

                                                  file9  Empty File (Empty File)
                                                  file9  Empty File (Empty File)
                                                  file9  Empty File (Empty File)
                                                  file9  Empty File (Empty File)
                                                  file9  Empty File (Empty File)
                                                  file9  Empty File (Empty File)
                                                  file9  Empty File (Empty File)
                                                  file9  Empty File (Empty File)
                                                  file9  Empty File (Empty File)
                                                  file9  Empty File (Empty File)
                                                  file9  Empty File (Empty File)
                                                  file9  Empty File (Empty File)
                                                  file9  Empty File (Empty File)
                                                  file9  Empty File (Empty File)
                                                  file9  Empty File (Empty File)
                                                  file9  Empty File (Empty File)
                                                  file9  Empty File (Empty File)
                                                  file9  Empty File (Empty File)
                                                  file9  Empty File (Empty File)
                                                  file9  Empty File (Empty File)

               lsp "/tmp/problem", 20 files, 0 directories
dborzov commented 10 years ago

Good catch, thank you for letting me know. i will look into this

dborzov commented 10 years ago

Hm, that is weird. I was not able to reproduce this issue on MacOS and Ubuntu, not sure what is up :0

jerdmann commented 10 years ago

Cool, hopefully it's just my machine. I'll let you know if I can reproduce the problem anywhere else. Thanks for looking. =D

On Tue, Oct 7, 2014 at 9:25 AM, Peter Borzov notifications@github.com wrote:

Hm, that is weird. I was not able to reproduce this issue on MacOS and Ubuntu, not sure what is up :0

— Reply to this email directly or view it on GitHub https://github.com/dborzov/lsp/issues/9#issuecomment-58192305.

Jason Erdmann | TTNET Monitoring Systems Engineer | (312)268-1623

pawamoy commented 9 years ago

I get the same problem on my laptop, Ubuntu Trusty, using go1.4, gvm v1.0.22

pawamoy commented 9 years ago

Hmmm I just solved it (less than 1 minute, :open_mouth:) It seems that the bug occurs when you use lsp with a different go version than the one you installed lsp with. Is it possible ? I first installed it using go provided by sudo apt-get install gccgo-go, then I switched on go1.4 using gvm use go1.4, and lsp was not working. After that I just re-ran go get github.com/dborzov/lsp with go1.4 and now it works.