-
-
Notifications
You must be signed in to change notification settings - Fork 163
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
Run fzf #322
Comments
If anyone uses fzf, I could help on this!! https://github.com/oilshell/oil/wiki/How-To-Test-OSH https://github.com/oilshell/oil/wiki/Shell-Programs-That-Run-Under-OSH |
@andychu I actually do run fzf (from time to time at least) and since I really wanted to give OSH a try, I've decided to see if I can get it to work. Sadly, when I tried to source FZF's bash injection script, I ended up with the following stack trace:
I am not sure what Thanks! |
I gave it some more time and this is what I found: The line this breaks on is if [[ ! -o vi ]]; then which basically checks whether the https://www.gnu.org/software/bash/manual/bash.html#Bash-Conditional-Expressions |
And one last thing before I finish here: once I've patched OSH to always evaluate the expression above as False, I was able to successfully source the osh$ source /home/xg/.fzf.bash
bind '"\er": redraw-current-line'
^~~~
/home/user/.fzf/shell/key-bindings.bash:70: Can't execute 'bind': No such file or directory
bind '"\e^": history-expand-line'
^~~~
/home/user/.fzf/shell/key-bindings.bash:71: Can't execute 'bind': No such file or directory
if [ $BASH_VERSINFO -gt 3 ]; then
^~~
/home/user/.fzf/shell/key-bindings.bash:74: (test) Expected unary operator, got '-gt' (2 args)
bind '"\C-t": " \C-u \C-a\C-k`__fzf_select__`\e\C-e\C-y\C-a\C-y\ey\C-h\C-e\er \C-h"'
^~~~
/home/user/.fzf/shell/key-bindings.bash:79: Can't execute 'bind': No such file or directory
bind '"\C-r": " \C-e\C-u`__fzf_history__`\e\C-e\e^\er"'
^~~~
/home/user/.fzf/shell/key-bindings.bash:83: Can't execute 'bind': No such file or directory
bind '"\ec": " \C-e\C-u`__fzf_cd__`\e\C-e\er\C-m"'
^~~~
/home/user/.fzf/shell/key-bindings.bash:86: Can't execute 'bind': No such file or directory
In general the |
@mrshu Perfect, thanks for trying this. I can implement
Oil won't have |
Oh since you said you were interested in implementing it -- if you look at |
@andychu Thanks for the updates and pointers! I was actually able to get FZF to run after applying both #349 and #348, although it worked in a somewhat strange way. When you invoke FZF in bash (by pressing Ctrl/Cmd+R) you basically get a fzf-ied window with your bash history. In OSH, after pressing Ctrl/Cmd+R, the command line changed to
and I only managed to get to the fzf-ied window with OSH history by pressing Enter. It therefore seem that bind interprets these backticks and runs the appropriate function(s). Would you happen to have some view as to how to proceed here? If my understanding is correct, something like interpreting those backticks would have to happen somewhere close to where readline is being wrapped around (i.e. |
@mrshu Great thanks for making such quick progress on this! I will try to reproduce this later with your patches. But one thing that might help is the https://github.com/oilshell/oil/wiki/Debugging-Completion-Scripts Basically I do So you can see what happens when you hit various keys. The output can be very messy and hard to read, but I'm open to improving it! This is how I debugged a lot of I don't know exactly why an extra Enter would be required. But I do know that At times I have had to read bash's code to figure out what options they're using. It could be some silly global flag. I forked We should chat on oilshell.zulipchat.com if you have more questions with this! I'm excited to be able to run https://github.com/oilshell/oil/wiki/Shell-Programs-That-Run-Under-OSH |
TODO: try this! |
@andychu it's been a while I guess 🙂 Do you think it's still worth trying out? |
Sorry for the delayed response :-/ I definitely think running https://github.com/oilshell/oil/wiki/Shell-Programs-That-Run-Under-OSH Though looking back on the history of this bug, I suspect the issue is the lack of the For some context about the project, see this comment: https://news.ycombinator.com/item?id=28547185 (should appear on the blog at some point) Basically I'm punting the interactive shell (which includes But I would very much like it if someone pushes on the interactive shell in the meantime! Chat with me on Zulip about it :) I think the |
|
Yes, with 0.22.0 |
https://github.com/junegunn/fzf/blob/master/shell/completion.bash
From #320
The text was updated successfully, but these errors were encountered: