From 0960c9a30813bc7fd6ae13db8f8d655fca6b8545 Mon Sep 17 00:00:00 2001 From: Rafael Fourquet Date: Thu, 2 Jul 2020 19:55:58 +0200 Subject: [PATCH] REPL prefix search: add ^x "pass through" key (#36173) --- stdlib/REPL/src/LineEdit.jl | 1 + stdlib/REPL/test/repl.jl | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/stdlib/REPL/src/LineEdit.jl b/stdlib/REPL/src/LineEdit.jl index 6664ed0054720..9b02815441bff 100644 --- a/stdlib/REPL/src/LineEdit.jl +++ b/stdlib/REPL/src/LineEdit.jl @@ -2218,6 +2218,7 @@ const prefix_history_keymap = merge!( match_input(map, s, IOBuffer(c))(s, keymap_data(ps, mode(s))) end, # match escape sequences for pass through + "^x*" => "*", "\e*" => "*", "\e[*" => "*", "\eO*" => "*", diff --git a/stdlib/REPL/test/repl.jl b/stdlib/REPL/test/repl.jl index bf4a33897bc2c..ba84eb579ec33 100644 --- a/stdlib/REPL/test/repl.jl +++ b/stdlib/REPL/test/repl.jl @@ -332,6 +332,13 @@ fake_repl(options = REPL.Options(confirm_exit=false,hascolor=false)) do stdin_wr @test endswith(s2, " 0x321\r\e[13C|||") # should have a space (from Meta-rightarrow) and not # have a spurious C before ||| (the one here is not spurious!) + # "pass through" for ^x^x + write(stdin_write, "\x030x4321\n") # \x03 == ^c + readuntil(stdout_read, "0x4321") + write(stdin_write, "\e[A\x18\x18||\x18\x18||||") # uparrow, ^x^x||^x^x|||| + s3 = readuntil(stdout_read, "||||", keep=true) + @test endswith(s3, "||0x4321\r\e[15C||||") + # Delete line (^U) and close REPL (^D) write(stdin_write, "\x15\x04") Base.wait(repltask)