Closed gthb closed 1 year ago
I wonder if your .zshrc has some code that exits early if it has been sourced before. In general I just restart the shell when installing.
Tried to test that by commenting out the eval
line, starting a new terminal in kitty, verifying that Ctrl-R was not invoking McFly, then uncommenting the eval
line and surrounding it by echos:
echo 'evaling mcfly'
eval "$(mcfly init zsh)"
echo 'done evaling mcfly'
and then sourcing .zshrc:
$ source ~/.zshrc
evaling mcfly
done evaling mcfly
so it did run ... but, uh, then McFly worked. So this failed to reproduce. 😞 I.e. I can't rule out that what you described was the problem when I got the problem.
I wonder if this had to do with whatever shenanigans underlie PowerLevel10k's “instant prompt” feature (which, yes, I have enabled at the top of my .zshrc). Maybe that causes some of .zshrc not to run (though their description of the feature doesn't sound like it should).
I notice that they recommend not to source .zshrc at all:
Weird things happen after typing
source ~/.zshrc
It's almost always a bad idea to run
source ~/.zshrc
, whether you are using Powerlevel10k or not. This command may result in random errors, misbehaving code and progressive slowdown of Zsh.If you've made changes to
~/.zshrc
or to files sourced by it, restart Zsh to apply them. The most reliable way to do this is to typeexit
and then start a new Zsh session. You can also useexec zsh
. While not exactly equivalent to complete Zsh restart, this command is much more reliable thansource ~/.zshrc
.
... which I guess gels with what you said,
In general I just restart the shell
Thanks for testing it out. I do suspect it was instant prompt or something similar. 🤷
As mentioned in #254, a quick fix for this is to, instead of eval "$(mcfly init zsh)"
, just use source <(mcfly init zsh)
.
I believe this is fixed now.
New to McFly, I followed the installation instructions in the readme (in Kitty, running zsh), and in this line:
... I tried the former, just sourcing
.zshrc
. But Ctrl+R still just invoked the familiar oldbck-i-search
experience.I tried to troubleshoot that for a while, hunt down where the relevant
bindkey
was invoked etc., but in the end I gave up and restarted Kitty. After that, Ctrl+R invoked McFly as expected.Is it expected behavior that sourcing
.zshrc
will not suffice in some circumstances? Then maybe change that line to say something like “Run. ~/.bashrc
[...] to reload your shell configuration, and then try Ctrl+R. If that doesn't bring up McFly, restart your terminal emulator”.But if sourcing shell config is always supposed to be enough, then maybe there's some initialization problem to hunt down?