fork/fish-shell

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

Łukasz WieczorekReformat with black.82750bbae

master
852 B45 linesraw
1#!/usr/bin/env python3
2from pexpect_helper import SpawnedProc
3
4sp = SpawnedProc()
5send, sendline, sleep, expect_prompt, expect_re, expect_str = (
6    sp.send,
7    sp.sendline,
8    sp.sleep,
9    sp.expect_prompt,
10    sp.expect_re,
11    sp.expect_str,
12)
13expect_prompt()
14
15sendline("set -g fish_autosuggestion_enabled 0")
16expect_prompt()
17sendline("bind U,n,d,o undo; bind R,e,d,o redo")
18expect_prompt()
19
20send("echo word")
21expect_str("echo word")
22
23send("Undo")
24expect_str("echo")
25
26send("Redo\r")
27expect_prompt("echo word")
28
29sendline(
30    "bind x begin-undo-group 'commandline -i \"+ \"' 'commandline -i 3' end-undo-group"
31)
32expect_prompt()
33send("math 2 x\r")
34expect_prompt("5")
35
36send("math 4x")
37send("Undo1\r")
38expect_prompt("41")
39
40send("math 5 x")
41send("\x02")  # c-b, moving before the 3
42send("Undo")
43send("Redo")
44send("9\r")  # 5 + 93
45expect_prompt("98")