fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

NahorFix failing system tests on Cygwin440e7fcbc

master
2.2 KiB93 linesraw
1#RUN: %fish %s
2#REQUIRES: command -v tmux
3
4isolated-tmux-start -C '
5    function fish_prompt
6        printf "prompt $status_generation> <status=$status> <$prompt_var> "
7        set prompt_var ""
8    end
9    function on_prompt_var --on-variable prompt_var
10        commandline -f repaint
11    end
12    function token-info
13        __fish_echo echo "current token is <$(commandline -t)>"
14    end
15    bind ctrl-g token-info
16'
17
18isolated-tmux capture-pane -p
19# CHECK: prompt 0> <status=0> <>
20
21if __fish_is_cygwin
22    # See issue #12074
23    echo "prompt 0> <status=0> <changed>"
24else
25    set -q CI && set sleep sleep 10
26    set -U prompt_var changed
27    tmux-sleep
28    isolated-tmux send-keys Enter
29end
30# CHECK: prompt 0> <status=0> <changed>
31
32isolated-tmux send-keys echo Space 123
33tmux-sleep
34isolated-tmux send-keys C-g
35tmux-sleep
36isolated-tmux capture-pane -p
37# CHECK: prompt 0> <status=0> <> echo 123
38# CHECK: current token is <123>
39# CHECK: prompt 0> <status=0> <> echo 123
40
41isolated-tmux send-keys C-u '
42function fish_prompt
43    printf "full line prompt\nhidden<----------------------------------------------two-last-characters-rendered->!!"
44end' Enter C-l
45isolated-tmux send-keys 'test "' Enter 'indent"'
46tmux-sleep
47isolated-tmux capture-pane -p
48# CHECK: full line prompt
49# CHECK: …<----------------------------------------------two-last-characters-rendered->!!
50# CHECK: test "
51# CHECK: indent"
52
53isolated-tmux send-keys C-c '
54    function fish_prompt
55        string repeat (math $COLUMNS) x
56    end
57' C-l 'echo hello'
58tmux-sleep
59isolated-tmux capture-pane -p
60# CHECK: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
61# CHECK: echo hello
62
63isolated-tmux send-keys C-c '
64    function fish_prompt
65        seq (math $LINES + 1)
66    end
67    function fish_right_prompt
68        echo test
69    end
70' Enter
71tmux-sleep
72isolated-tmux capture-pane -p -S -11
73# CHECK: 1
74# CHECK: 2
75# CHECK: 3
76# CHECK: 4
77# CHECK: 5
78# CHECK: 6
79# CHECK: 7
80# CHECK: 8
81# CHECK: 9
82# CHECK: 10
83# CHECK: 11                                                                          test
84# CHECK: 2
85# CHECK: 3
86# CHECK: 4
87# CHECK: 5
88# CHECK: 6
89# CHECK: 7
90# CHECK: 8
91# CHECK: 9
92# CHECK: 10
93# CHECK: 11                                                                          test