Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kidonng
Copy link

@kidonng kidonng commented Jan 8, 2025

This was originally included in #265 to detect support for bind -M, but versions not supporting the feature were long archaic, and the detection practically becomes if true:

$ codespace:/> fish --version
fish, version 3.1.0
$ codespace:/> bind -M insert # By default there's no mode-specific bindings
$ codespace:/> if bind -M insert &> /dev/null; echo true; end
true

It also has a small cost for users with considerable mode-specific bindings, e.g. with fish_vi_key_bindings enabled:

$ time bind -M insert &> /dev/null

________________________________________________________
Executed in    1.34 millis    fish           external 
   usr time  541.00 micros  541.00 micros    0.00 micros 
   sys time  492.00 micros  492.00 micros    0.00 micros

(Note in this very case it's just ~1ms, but this check is prevalent and can add up. I'd like to address this in other programs too.)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant