Skip to content

Panic on completer if reverse search is used #85

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

Closed
omani opened this issue Mar 30, 2018 · 3 comments · Fixed by #86
Closed

Panic on completer if reverse search is used #85

omani opened this issue Mar 30, 2018 · 3 comments · Fixed by #86
Labels

Comments

@omani
Copy link
Contributor

omani commented Mar 30, 2018

Hi abiosoft,

to reproduce this, do the following:

  • enable history
  • type in some command
$ exit
  • now start shell again and do a reverse search with CTRL+R (like we used to do in bash)
  • and type "ex" to let it find "exit"
CTRL+R ex

prompt will show:

$ exit
bck-i-search: ex 

so far so good. now since you've found the desired command, you could hit enter to execute it. but instead just try to complete the command by hitting tab.

panic at completer.go line 28.

you can try it with the main.go in examples. you will have to enable history for this to work though.

shell.SetHistoryPath("/tmp/history") so you can backsearch in the first place.

@abiosoft abiosoft added the bug label Mar 30, 2018
@abiosoft
Copy link
Owner

It never occurred to me that I can search history.

Thanks for reporting this. I will have a look when I have time, hopefully soon.

@omani
Copy link
Contributor Author

omani commented Mar 30, 2018

I've found out that this bug is happening when you just move the cursor in front of a word and try to complete it. which is the case when doing above mentioned reverse search. so it is not dependent on a reverse search at all.

#86 fixes this.

@abiosoft
Copy link
Owner

Thanks @omani :)

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

Successfully merging a pull request may close this issue.

2 participants