# Interactive: the built-in editor in vi mode. command -v python3 >/dev/null 2>&1 || exit 77 PS1='$ ' ENV='' HISTFILE='' python3 "$TESTS/tools/ptydrive.py" "$TSH" -o vi <<'END' send echo hello world\x1b0wcwBYE\x1b\r expect BYE world send \x1bk\r expect BYE world send echo one two three\x1bbbdw\r expect one three send echo one two three\x1b0wD\r send echo abc\x1b0wiX\x1bA!\x1bIecho \x1b\r expect echo Xabc! send echo 12345\x1bhhhx2xrQ\r expect 1Q send echo a b\x1b0wyw$p\r expect a ba send echo undo me\x1bddu\r expect undo me send echo upper\x1b0w5~\r expect UPPER send echo x\x1b/BYE\r\r expect BYE world send echo count\x1b03lx\r expect ech count send echo comment\x1b# send echo done\r expect done # `.` repeats the last change, insert mode and all send echo abcdef\x1b0wx..\r expect echo def send echo one two three\x1b0dw.\r expect two three send echo one two three\x1b0cwZZ\x1bw.\r expect ZZ ZZ two three # `y` over an empty range, with nothing killed yet: nothing is pasted and # no null buffer reaches memcpy (ASan sees that one). send \x15echo yank\x1b0y0\r expect echo yank # ... and a count repeats it that many times, on top of the change's own send echo abcdef\x1b0x3.\r expect abcdef # a motion is not a change: `.` still repeats the last real one send echo abcdef\x1b0wx send l. send \r expect echo bdef # `/` typed over the previous pattern and backspaced to empty repeats the # previous search, not a mix of the two patterns. send echo apple\r expect apple send echo banana\r expect banana send \x1b/apple\r\r expect echo apple send \x1b/ban\x7f\x7f\x7f\r\r expect echo apple send exit\r END