mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-28 04:03:39 +08:00
444f9f8715
This allows for marking certain bindings as part of a preset, which allows us to - only erase those when switching presets - go back to the preset binding when erasing a user binding - only show user customization if requested - make bare bind statements in config.fish work (!!!11elf!!!) Fixes #5191. Fixes #3699.
34 lines
1.1 KiB
Fish
34 lines
1.1 KiB
Fish
# Test various `bind` command invocations. This is meant to verify that
|
|
# invalid flags, mode names, etc. are caught as well as to verify that valid
|
|
# ones are allowed.
|
|
|
|
echo \# Verify that an invalid bind mode is rejected. >&2
|
|
bind -m 'bad bind mode' \cX true
|
|
echo \# Verify that an invalid bind mode target is rejected. >&2
|
|
bind -M bind-mode \cX true
|
|
|
|
# This should succeed and result in a success, zero, status.
|
|
bind -M bind_mode \cX true
|
|
|
|
### HACK: All full bind listings need to have the \x7f -> backward-delete-char
|
|
# binding explicitly removed, because on some systems that's backspace, on others not.
|
|
echo \# Listing bindings
|
|
bind | string match -v '*backward-delete-char'
|
|
bind --user --preset | string match -v '*backward-delete-char'
|
|
echo \# Preset only
|
|
bind --preset | string match -v '*backward-delete-char'
|
|
echo \# User only
|
|
bind --user | string match -v '*backward-delete-char'
|
|
|
|
echo \# Adding bindings
|
|
bind \t 'echo banana'
|
|
bind | string match -v '*backward-delete-char'
|
|
echo \# Erasing bindings
|
|
bind --erase \t
|
|
bind \t
|
|
bind \t 'echo wurst'
|
|
bind --erase --user --preset \t
|
|
bind \t
|
|
|
|
exit 0
|