fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
ff284d642
master
1#RUN: %fish %s 2#REQUIRES: command -v tmux 3 4isolated-tmux-start -C' 5set -g fish_autosuggestion_enabled 0 6function abbr-test 7end 8abbr -g abbr-test "abbr-test [expanded]" 9' 10 11if { command -v less && ! less --version 2>&1 | grep BusyBox} > /dev/null 12isolated-tmux send-keys"abbr --help | sed 1q | less" Enter 13tmux-sleep 14isolated-tmux capture-pane -p 15isolated-tmux send-keys q 16else 17echo '(END)' 18echo 'prompt 0> abbr --help | sed 1q | less' 19echo 'Documentation for abbr' 20end 21# CHECK: (END) 22# CHECK: prompt 0> abbr --help | sed 1q | less 23# CHECK: Documentation for abbr 24 25# Expand abbreviations on space. 26isolated-tmux send-keys abbr-test Space arg1 Enter 27tmux-sleep 28# CHECK: prompt {{\d+}}> abbr-test [expanded] arg1 29 30# Expand abbreviations at the cursor when executing. 31isolated-tmux send-keys abbr-test Enter 32tmux-sleep 33# CHECK: prompt {{\d+}}> abbr-test [expanded] 34 35# Use Control+Z right after abbreviation expansion, to keep going without expanding. 36isolated-tmux send-keys abbr-test Space C-z arg2 Enter 37tmux-sleep 38# CHECK: prompt {{\d+}}> abbr-test arg2 39 40# Same with a redundant space; it does not expand abbreviations. 41isolated-tmux send-keys C-u abbr-test Space C-z Space arg2 Enter 42tmux-sleep 43# CHECK: prompt {{\d+}}> abbr-test arg2 44 45# Or use Control+Space to the same effect. 46isolated-tmux send-keys abbr-test C-Space arg3 Enter 47tmux-sleep 48# CHECK: prompt {{\d+}}> abbr-test arg3 49 50# Do not expand abbreviation if the cursor is not at the command, even if it's just white space. 51# This makes the behavior more consistent with the above two scenarios. 52isolated-tmux send-keys abbr-test C-Space Enter 53tmux-sleep 54# CHECK: prompt {{\d+}}> abbr-test 55 56# CHECK: prompt {{\d+}}> 57 58isolated-tmux capture-pane -p