garybernhardt / selecta

A fuzzy text selector for files and anything else you need to select. Use it from vim, from the command line, or anywhere you can run a shell command.
MIT License
1.34k stars 81 forks source link

Prompt left at top of choices after choosing an option #98

Closed airblade closed 8 years ago

airblade commented 8 years ago

An animated gif would provide the clearest explanation but I'm not sure how to make one. So here's a screenshot of the end result:

screen shot 2016-02-09 at 10 39 44 am

When I use selecta via my proj function, which looks like this:

cd $(find ~/code/src -maxdepth 3 -type d | selecta)

– and I make a choice, the prompt isn't placed below the choices; it overwrites at the top.

This started happening after I upgraded to 8cb52e7. I'm not sure what commit I was at before but I hadn't updated for a few months. I'm using OS X 10.11.3's Terminal.app and Ruby 2.3.0p0.

gshutler commented 8 years ago

Seeing similar behaviour. selecta appears to move the cursor down a few lines on termination rather than 20 or so as it did before. Therefore if you still have several options visible when you make your selection your cursor ends up in the middle of them rather than below them.

gshutler commented 8 years ago

Example against this repo:

~/Code/garybernhardt/selecta master
$ ls | selecta
 4 > g
Gemfile
demo.gif
~/Code/garybernhardt/selecta master
$ lecta.gemspec
garybernhardt commented 8 years ago

This doesn't normally happen on my machine, but I can reproduce it if I remove all environment variables and zsh configuration by doing env -i zsh -f -d. With all of my usual configs in place, the cursor ends where it does for both of you, but those extra lines are somehow magically cleared at termination. Fun!

I just pushed e74ee23, which seems to fix this. Can one of you confirm that?

garybernhardt commented 8 years ago

Err... that commit has its own bug; let me fix that real quick...

garybernhardt commented 8 years ago

OK; I fixed that. The new HEAD is 96df2e9 and definitely works and there will never be bugs again, ever!

gshutler commented 8 years ago

Looks good to me from a quick test.

airblade commented 8 years ago

Works for me. Many thanks!

airblade commented 8 years ago

I should have mentioned at the start I'm using OS X's system bash, i.e. GNU bash v3.2.57(1)-release. Sorry!