File: bind.in

package info (click to toggle)
fish 3.0.2-2%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 36,448 kB
  • sloc: ansic: 75,559; cpp: 43,314; sh: 9,096; javascript: 7,710; python: 2,538; makefile: 1,461; objc: 709; perl: 367; xml: 18
file content (33 lines) | stat: -rw-r--r-- 1,104 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# 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