Skip to content

Commit 0960c9a

Browse files
authored
REPL prefix search: add ^x "pass through" key (#36173)
1 parent 955beb6 commit 0960c9a

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

stdlib/REPL/src/LineEdit.jl

+1
Original file line numberDiff line numberDiff line change
@@ -2218,6 +2218,7 @@ const prefix_history_keymap = merge!(
22182218
match_input(map, s, IOBuffer(c))(s, keymap_data(ps, mode(s)))
22192219
end,
22202220
# match escape sequences for pass through
2221+
"^x*" => "*",
22212222
"\e*" => "*",
22222223
"\e[*" => "*",
22232224
"\eO*" => "*",

stdlib/REPL/test/repl.jl

+7
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,13 @@ fake_repl(options = REPL.Options(confirm_exit=false,hascolor=false)) do stdin_wr
332332
@test endswith(s2, " 0x321\r\e[13C|||") # should have a space (from Meta-rightarrow) and not
333333
# have a spurious C before ||| (the one here is not spurious!)
334334

335+
# "pass through" for ^x^x
336+
write(stdin_write, "\x030x4321\n") # \x03 == ^c
337+
readuntil(stdout_read, "0x4321")
338+
write(stdin_write, "\e[A\x18\x18||\x18\x18||||") # uparrow, ^x^x||^x^x||||
339+
s3 = readuntil(stdout_read, "||||", keep=true)
340+
@test endswith(s3, "||0x4321\r\e[15C||||")
341+
335342
# Delete line (^U) and close REPL (^D)
336343
write(stdin_write, "\x15\x04")
337344
Base.wait(repltask)

0 commit comments

Comments
 (0)