# Interactive: `bind`, the key bindings of the BSD shells. command -v python3 >/dev/null 2>&1 || exit 77 PS1='$ ' ENV='' HISTFILE='' python3 "$TESTS/tools/ptydrive.py" "$TSH" <<'END' # -l lists what the editor can run send bind -l | grep -c up-history\r expect 1 # a bound sequence runs its action: ESC accepts the line send bind '^['=accept-line\r send echo BOUND\x1b expect BOUND # a key the editor knows, moved to another action: Insert recalls history send bind '^[[2~'=up-history\r send echo AAA\r send echo \x1b[2~\r expect AAA # a name the editor does not have is an error, and binding still works send bind '^[[2~'=nosuch\r expect bind: nosuch: no such editing command send bind -m '^X'=macro\r expect bind: -m: macros are not supported send echo STILL-OK\r expect STILL-OK send exit\r END