Skip to content

Unknown keybinding 13 error with 2.3.0 and up #3210

Closed

Description

@martinklepsch

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:

fish: Unknown keybinding 13

which seems to originate from reader.cpp.

If there's any more information I could provide please let me know. 👍

Activity

  1. krader1961 commented on Jul 6, 2016

    @krader1961
    Contributor

    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 \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.

  2. martinklepsch commented on Jul 6, 2016

    @martinklepsch
    Author

    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.)

  3. krader1961 commented on Jul 6, 2016

    @krader1961
    Contributor

    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.

  4. zanchey commented on Jul 7, 2016

    @zanchey
    Member

    I usually try env -i TERM=$TERM HOME=/tmp/foo fish to launch without any existing configuration.

  5. martinklepsch commented on Jul 7, 2016

    @martinklepsch
    Author

    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).

  6. martinklepsch commented on Jul 7, 2016

    @martinklepsch
    Author

    This might also be part of the problem:

    ~ echo $__fish_datadir
    /usr/local/Cellar/fish/2.2.0/share/fish
    ~ fish -v
    fish, version 2.3.1
    
  7. floam commented on Jul 7, 2016

    @floam
    Member

    Did you run that while the shell you had started before the 2.3.1 upgrade was still running by chance?

    echo $FISH_VERSION will show you the version of fish you are currently inside of instead of the version of fish installed to $PATH.

  8. krader1961 commented on Jul 28, 2016

    @krader1961
    Contributor

    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.

  9. martinklepsch commented on Aug 9, 2016

    @martinklepsch
    Author

    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

    function my_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.

  10. krader1961 commented on Aug 9, 2016

    @krader1961
    Contributor

    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
    
  11. krader1961 commented on Aug 9, 2016

    @krader1961
    Contributor

    This was asked earlier but did you restart all your fish shells (e.g., exec fish) after installing 2.3.1?

  12. martinklepsch commented on Aug 10, 2016

    @martinklepsch
    Author
    # 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.

  13. floam commented on Aug 10, 2016

    @floam
    Member

    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.

  14. floam commented on Aug 10, 2016

    @floam
    Member

    I'll suggest that a brew cleanup might 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.

  15. floam commented on Aug 10, 2016

    @floam
    Member

    Can you share your configuration files from /.config/fish?

  16. krader1961 commented on Aug 10, 2016

    @krader1961
    Contributor

    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.

  17. floam commented on Aug 10, 2016

    @floam
    Member

    @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:

    ~ echo $__fish_datadir
    /usr/local/Cellar/fish/2.2.0/share/fish
    

    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?

  18. floam commented on Aug 10, 2016

    @floam
    Member

    Let's keep this open until he gets a chance to tell us if he fixed it or not -- it's labeled "question".

  19. reopened this on Aug 10, 2016
  20. self-assigned this
    on Aug 10, 2016
  21. martinklepsch commented on Aug 10, 2016

    @martinklepsch
    Author

    Thanks for the continued help!

    brew cleanup indeed 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:

    Let's keep this open until he gets a chance to tell us if he fixed it or
    not -- it's labeled question.

    —
    You are receiving this because you were mentioned.
    Reply to this email directly, view it on GitHub
    #3210 (comment),
    or mute the thread
    https://github.com/notifications/unsubscribe-auth/AAF82Efod8dyGVGcfL1UpwJtRR7gNWXrks5qee_MgaJpZM4JF-tu
    .

  22. floam commented on Aug 10, 2016

    @floam
    Member

    Cool. Good luck!

    ... Maybe run brew doctor to be safe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions