fogine / rofi-search

Interactive Google / DuckDuckGo search via rofi
MIT License
100 stars 7 forks source link

clearing query causes crash #1

Closed vredesbyyrd closed 4 years ago

vredesbyyrd commented 4 years ago

Hi,

I installed your patched rofi-blocks and dropped rofi-search in my $PATH.

rofi command:

rofi -modi blocks -blocks-wrap /usr/local/bin/rofi-search -show blocks -lines 4 -eh 4 -kb-custom-1 'Control+y' -theme /home/clu/.config/rofi/brotab.rasi

Steps to reproduce

What behavior you see

Rofi exits with message:

[ERROR] string index out of range
BlocksMode-Message: 15:17:03.012: Child 309732 exited abnormally

What behavior you expect to see

I am unsure if this is expected behavior or perhaps a limitation of the implementation. If I clear the current query string, and quickly type another query a crash can be avoided.

Thanks for sharing this tool. It's impressive what can be accomplished with rofi, and rofi-search is making me rethink some of my own scripts, haha.

fogine commented 4 years ago

Thanks for the report @vredesbyyrd . I'm using current master and can't reproduce that. Do you use node>=8.2.1? if so, please set debug flag before the rofi command and post the output here

export ROFI_SEARCH_DEBUG=1

fogine commented 4 years ago

And also what search method do you use? cse, googler or ddgr?

vredesbyyrd commented 4 years ago

Sorry I forgot to post the search method. Debugging was already set.

export DDG_ARGS='["-n", 5]'
export GOOGLE_ARGS='["--count", 5]'
export ROFI_SEARCH='googler,ddgr'
export TITLE_COLOR='#74778B'
export ROFI_SEARCH_DEBUG=1

[ERROR] string index out of range is not printed to terminal with debugging off. Nodejs is 13.12.0-1 , this is on arch linux.

I just tried with the rasi theme you linked to and crash is still present. Only other possibly relevant thing i can think of is my shell is zsh.

fogine commented 4 years ago

Thanks for the additional info... It seems that the crash is caused only by the ddgr search method, I'll investigate and fix it..

vredesbyyrd commented 4 years ago

Right on, thank you.

vredesbyyrd commented 4 years ago

Works now, thanks for the quick fix.