You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unknown keybinding 13 error with 2.3.0 and up #3210
This issue exists with fish 2.3.0 and up on OS X (10.11). I confirmed it in Iterm and Terminal.app with a clean config (is there a toggle to start fish without any config? had to remove it manually).
To reproduce launch fish 2.3.0 or 2.3.1 in an OS X terminal and hit enter. Nothing happens. When starting with fish -d 2 the following message is printed every time enter is pressed:
This was changed last year but 2.3.0 is the first release since it was changed.
Character 13 is carriage-return, aka \cM and \r. It's what the [enter] or [return] key sends. The default bindings were modified to deal with this so apparently you've done something non-standard with your bindings.
Interesting, I actually looked at the changelog but didn't see anything standing out except for the fish_vi_key_bindings stuff (that I was using).
That said I emptied my config file and started a new shell showing the same symptoms, is there any way to start a fish shell without any configuration?
I just noticed that I have two functions that might interfere:
function fish_user_key_bindings
bind -M insert -m default kj backward-char force-repaint
end
and
function fish_user_keybinding
bind -M insert -m default kj backward-char force-repaint
end
Not sure why both of these exist, but could these be causing the issue? (I'll test in a bit can't do it right now unfortunately.)
The correct function name for defining user local bindings is fish_user_key_bindings not fish_user_keybinding so delete the latter function to reduce confusion. If you type bind \r followed by [ctrl-J] you should see bind \r execute displayed. If you don't then run bind \r execute and press [ctrl-J] and see if that fixes your [enter] key. Then look at your _$_fish_datadir/functions/fish_default_key_bindings.fish script (or wherever your global fish scripts are installed). It should contain these two lines near the top:
bind $argv \n execute
bind $argv \r execute
If it doesn't contain those lines, and given the behavior you're describing it probably does not, then your installation is broken.
Ok, so $__fish_datadir/functions/fish_default_key_bindings.fish contained
bind $argv \n execute
but not the binding for \r. I added it manually which made things work until I re-enabled fish_vi_key_bindings. Looking at this function (via funced fish_vi_key_bindngs) it erases all bindings and doesn't seem to re-add any bindings for \r or \n also it looks quite a bit different to the file defining the function in master (which is what's shipped with 2.3.1 I assume).
I'm going to assume @martinklepsch figured out what was wrong with his setup since there haven't been any updates in three weeks. Feel free to reopen this if you still have questions or haven't be able to get a satisfactorily working fish installation.
I'm sorry it's taken be so long to get back to this. Got a bit overwhelmed with all the different things to test :)
$FISH_VERSION is 2.3.1
$__fish_datadir is /usr/local/Cellar/fish/2.3.1/share/fish
in contrast to my earlier comment $__fish_datadir/functions/fish_default_key_bindings.fish now contains both bind $argv \n execute and bind $argv \r execute.
Still when adding either of the two following snippets I end up with Unknown keybinding 13
functionmy_vi_bindings
fish_vi_key_bindings
end
set -g fish_key_bindings my_vi_bindings
set -g fish_key_bindings fish_vi_key_bindings
Happy to try any suggestions you may have and sorry again for letting this sit so long.
Something is wrong with your installation. I can't reproduce and would not expect to be able to do so with a stock fish installation. What does bind | grep execute report before and after you enable vi mode? What do the following commands output:
sum $__fish_datadir/functions/fish_default_key_bindings.fish
sum $__fish_datadir/functions/fish_vi_key_bindings.fish
for fn_dir in $fish_function_path
test -r $fn_dir/fish_vi_key_bindings.fish
and echo $fn_dir/fish_vi_key_bindings.fish
end
# sum $__fish_datadir/functions/fish_default_key_bindings.fish
47973 5 /usr/local/Cellar/fish/2.3.1/share/fish/functions/fish_default_key_bindings.fish
# sum $__fish_datadir/functions/fish_vi_key_bindings.fish
46397 9 /usr/local/Cellar/fish/2.3.1/share/fish/functions/fish_vi_key_bindings.fish
# for fn_dir in $fish_function_path ...
/usr/local/Cellar/fish/2.2.0/share/fish/functions/fish_vi_key_bindings.fish
/usr/local/Cellar/fish/2.3.0/share/fish/functions/fish_vi_key_bindings.fish
/usr/local/Cellar/fish/2.3.1/share/fish/functions/fish_vi_key_bindings.fish
This was asked earlier but did you restart all your fish shells (e.g., exec fish) after installing 2.3.1?
I've been running 2.3.1 for weeks with the key bindings stuff commented out, full system restart inbetween.
What on earth. Why are 2.2.0 and 2.3.0's function dirs there? You've (seemingly) got three installations worth of scripts and they're three different versions of fish.
The problem is your $fish_function_path. Since the fish 2.2.0 functions directory appears first that will be the fish_vi_key_bindings function it loads and runs. And that version doesn't have the necessary binding for the [enter] key (\r). As @floam pointed out those directories should not be in that var. Fix that and you'll fix this issue.
@martinklepsch Check ls -ld /usr/local/share/fishand ls -ld /usr/local/share/fish/functions. Are either symlinks into Cellar? Only the files within those dirs should be symlinks. But you've been using Fish on brew long enough it's possible something funny happened.
Fish has a habit of over-resolving symlinks and Homebrew symlinks everything from Cellar into /usr/local. That day you posted this:
Maybe fish was installed in /usr/local/Cellar/fish/2.3.1/share/fish and then linked to /usr/local/share/fish/*.fish when you upgraded, but due to a rogue symlink from /usr/local/share/fish (or /usr/local/share/fish/functions) into /usr/local/Cellar/fish/2.2.0, the 2.3.0/2.3.1 symlinks intended for $prefix actually ended up being stored in Cellar as well, ontop of each other and 2.2.0?
Activity
krader1961 commentedon Jul 6, 2016
From the release notes (CHANGELOG.md):
This was changed last year but 2.3.0 is the first release since it was changed.
Character 13 is carriage-return, aka
\cMand\r. It's what the [enter] or [return] key sends. The default bindings were modified to deal with this so apparently you've done something non-standard with your bindings.martinklepsch commentedon Jul 6, 2016
Interesting, I actually looked at the changelog but didn't see anything standing out except for the
fish_vi_key_bindingsstuff (that I was using).That said I emptied my config file and started a new shell showing the same symptoms, is there any way to start a fish shell without any configuration?
I just noticed that I have two functions that might interfere:
and
Not sure why both of these exist, but could these be causing the issue? (I'll test in a bit can't do it right now unfortunately.)
krader1961 commentedon Jul 6, 2016
The correct function name for defining user local bindings is
fish_user_key_bindingsnotfish_user_keybindingso delete the latter function to reduce confusion. If you typebind \rfollowed by [ctrl-J] you should seebind \r executedisplayed. If you don't then runbind \r executeand press [ctrl-J] and see if that fixes your [enter] key. Then look at your _$_fish_datadir/functions/fish_default_key_bindings.fish script (or wherever your global fish scripts are installed). It should contain these two lines near the top:If it doesn't contain those lines, and given the behavior you're describing it probably does not, then your installation is broken.
zanchey commentedon Jul 7, 2016
I usually try
env -i TERM=$TERM HOME=/tmp/foo fishto launch without any existing configuration.martinklepsch commentedon Jul 7, 2016
Ok, so
$__fish_datadir/functions/fish_default_key_bindings.fishcontainedbut not the binding for
\r. I added it manually which made things work until I re-enabledfish_vi_key_bindings. Looking at this function (viafunced fish_vi_key_bindngs) it erases all bindings and doesn't seem to re-add any bindings for\ror\nalso it looks quite a bit different to the file defining the function in master (which is what's shipped with 2.3.1 I assume).martinklepsch commentedon Jul 7, 2016
This might also be part of the problem:
floam commentedon Jul 7, 2016
Did you run that while the shell you had started before the 2.3.1 upgrade was still running by chance?
echo $FISH_VERSIONwill show you the version of fish you are currently inside of instead of the version of fish installed to $PATH.krader1961 commentedon Jul 28, 2016
I'm going to assume @martinklepsch figured out what was wrong with his setup since there haven't been any updates in three weeks. Feel free to reopen this if you still have questions or haven't be able to get a satisfactorily working fish installation.
martinklepsch commentedon Aug 9, 2016
I'm sorry it's taken be so long to get back to this. Got a bit overwhelmed with all the different things to test :)
$FISH_VERSIONis2.3.1$__fish_datadiris/usr/local/Cellar/fish/2.3.1/share/fish$__fish_datadir/functions/fish_default_key_bindings.fishnow contains bothbind $argv \n executeandbind $argv \r execute.Still when adding either of the two following snippets I end up with
Unknown keybinding 13set -g fish_key_bindings fish_vi_key_bindingsHappy to try any suggestions you may have and sorry again for letting this sit so long.
krader1961 commentedon Aug 9, 2016
Something is wrong with your installation. I can't reproduce and would not expect to be able to do so with a stock fish installation. What does
bind | grep executereport before and after you enable vi mode? What do the following commands output:krader1961 commentedon Aug 9, 2016
This was asked earlier but did you restart all your fish shells (e.g.,
exec fish) after installing 2.3.1?martinklepsch commentedon Aug 10, 2016
I've been running 2.3.1 for weeks with the key bindings stuff commented out, full system restart inbetween.
floam commentedon Aug 10, 2016
What on earth. Why are 2.2.0 and 2.3.0's function dirs there? You've (seemingly) got three installations worth of scripts and they're three different versions of fish.
floam commentedon Aug 10, 2016
I'll suggest that a
brew cleanupmight fix it when it deletes the unlinked 2.2.0 and 2.3.0 paths in Cellar.But how is it accumulating those like that as he upgraded? That shouldn't be necessary to run that.
floam commentedon Aug 10, 2016
Can you share your configuration files from
/.config/fish?krader1961 commentedon Aug 10, 2016
The problem is your
$fish_function_path. Since the fish 2.2.0 functions directory appears first that will be thefish_vi_key_bindingsfunction it loads and runs. And that version doesn't have the necessary binding for the [enter] key (\r). As @floam pointed out those directories should not be in that var. Fix that and you'll fix this issue.floam commentedon Aug 10, 2016
@martinklepsch Check
ls -ld /usr/local/share/fishandls -ld /usr/local/share/fish/functions. Are either symlinks into Cellar? Only the files within those dirs should be symlinks. But you've been using Fish on brew long enough it's possible something funny happened.Fish has a habit of over-resolving symlinks and Homebrew symlinks everything from Cellar into
/usr/local. That day you posted this:Maybe fish was installed in
/usr/local/Cellar/fish/2.3.1/share/fishand then linked to/usr/local/share/fish/*.fishwhen you upgraded, but due to a rogue symlink from/usr/local/share/fish(or/usr/local/share/fish/functions) into/usr/local/Cellar/fish/2.2.0, the2.3.0/2.3.1symlinks intended for$prefixactually ended up being stored in Cellar as well, ontop of each other and 2.2.0?floam commentedon Aug 10, 2016
Let's keep this open until he gets a chance to tell us if he fixed it or not -- it's labeled "question".
martinklepsch commentedon Aug 10, 2016
Thanks for the continued help!
brew cleanupindeed fixed it. Yay!The two directories you mentioned only contain files which are symlinks.
None of the directories are symlinks themselves.
If there's anything more that I should check I'm happy to but given my
original issue is resolved this can be closed :)
Thanks again, really appreciate your help and everyone's work on fish.
On Wed, 10 Aug 2016 at 17:35, Aaron Gyes [email protected] wrote:
floam commentedon Aug 10, 2016
Cool. Good luck!
... Maybe run
brew doctorto be safe