-
Notifications
You must be signed in to change notification settings - Fork 175
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
Zsh #81
Conversation
From my brief usage it seems to function fine. There does seem to be some unneeded command history after ctrl+r to use mcfly and after selecting a command such as:
It would be better if these were hidden from the terminal. Not sure if this is intentional. |
Interesting, I wasn’t getting those. What ZSH history settings are you using?
|
You can find my full .zshrc here (with fzf replaced with mcfly of course) Relevant? Zsh history ops:
|
@cantino Thank you! This is awesome. I just installed this and briefly tested. I'm running I didn't get any extra lines in history files or terminal (those that @Flat mentioned). Ps. I didn't even remember what is mcfly since I never tried it before. I had just subscribed to notifications on the issue about zsh support and remembered that it was something I wanted to have but couldn't before. This is a very nice improvement to my workflow as I often use Ctrl+R search and the default one had pretty bad UX. |
I'm not sure what happened. I'm very sure I didn't get those extra lines when I tried this first time but noticed now (after reboot etc.) that now I get those extra lines showing in my terminal after using Ctrl+R:
|
Are they in your command history, or just in the terminal buffer?
|
For me they seem to just be in the terminal buffer. Not in .zsh_history. |
That's the same behavior as bash. I haven't found a good way to prevent them, although @infokiller's suggestion might work for zsh. |
If anyone wants to test it again, I've worked with @infokiller's feedback and think I've removed the |
@cantino I just updated to the latest version in this branch (commit 8eecd8d) and I don't get the Otherwise this seems to work, but now arrow keys don't work in mcfly anymore to navigate up or down the suggestions list. Esc, Tab and Enter at least work as they should (can edit or run the first suggestion easily). Actually while writing this I just noticed that PageUp and PageDown keys work to navigate the suggestions up/down, but I would much prefer to use arrow keys for it instead. I'm pretty sure arrow keys worked for this when I was using the initial version of this (commit 5a5784a) |
Thanks @Haprog, yes, that was definitely working before. Darn, I wonder if I can make zsh not consume those. |
Hey @Haprog, are you trying the current version? Arrow keys are working for me in zsh. Vim or emacs mode? |
@cantino I'm running this latest After having first installed the older version of this branch I just pulled latest updates (to get my branch up to date with latest changes) and ran The arrow keys still don't seem to work (I've also rebooted my laptop since last try).
This is a bit confusing to me since I have no idea what is the difference and so I have just used the defaults without setting I tried setting it to |
Can I switch between different versions just by switching the binary at I'm just thinking I could try compiling different versions from different commits and backup the binary after compilation to be able to switch back to better working version faster without having to run cargo install every time. |
I just noticed that if I manually run |
I tested different versions of the Arrow keys still work after Ctrl+R when using this commit: But after the next commit the arrow keys don't work with Ctrl+R anymore: |
I just tested this branch also on Windows 10 running it with zsh in WSL1 (Ubuntu 20.04). Tested with two terminal apps: Command Prompt (cmd.exe, default) and the newer separately installed Windows Terminal. Both have the same issue for me that arrow keys don't work in McFly when starting it with Ctrl+R but works when started manually with command And if I just downgrade the |
Thanks @Haprog for all of your testing! I'll see if I can reproduce this and figure it out. |
Tried mcfly @ 8eecd8d with...
...and arrow keys don't work, but Ah, I just tried invoking I also tried Side note: in case anyone uses zplug, this is how I added mcfly: # As a "plugin" to source key binding
zplug "cantino/mcfly", at:zsh, use:mcfly.zsh
# As a "command" to compile binary and add it to $PATH
zplug "cantino/mcfly", \
at:zsh, \
as:command, \
use:"target/release/mcfly", \
hook-build:"cargo install --path ." |
@cantino I guess you could try to reproduce it in a fresh Ubuntu virtual machine if you can't reproduce it on your mac directly. You can get ready to go virtual machine images of Ubuntu for VirtualBox (free) or VMware from here https://www.osboxes.org/ubuntu/ |
Okay, so this has something to do with normal mode vs application mode in the terminal. https://invisible-island.net/ncurses/ncurses.faq.html#cursor_appmode I don't really understand it. If I do What's strange is that they work find even without the TERM overloaded if you just run EDIT: This definition of
EDIT 2: And, while this fixes it for my Ubuntu VM, it breaks it on my Mac. Any ideas? EDIT 3: It appears to be just
I have noticed that mcfly is slower to come up in zsh and then bash, and I'm not sure why. |
@cantino I just took a look at all the comments since my last review. enable-term-application-mode() { echoti smkx }
disable-term-application-mode() { echoti rmkx } Then, call |
I just quickly tested the latest version and it seems to work perfectly. Thanks for the updates!
At least I don't notice any delay when opening mcfly in zsh (though I'm on pretty high end hardware). It opens immediately for me. Maybe the slowness is only noticeable in a VM? |
Awesome, that seems to be working! Mind testing again? |
Does the new version work for you @jrolfs? |
Still works great after the |
I think this is mergeable now? |
Would love to see this merged |
Done! Releasing 0.4.0 now 🥳 |
Sorry, I missed all these notifications somehow but glad y’all figured it out. Will switch over to master when I’m back on a 💻! |
Late to the party but just wanted to say thanks to everyone involved for adding zsh support! Been using mcfly for a while now and love it ❤️ Thank you for creating such an amazing piece of software! |
Thanks @Stormheg ❤️ |
Initial work on Zsh support. I'm currently testing it locally.
Fixes #64. Fixes #3.