Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REPL prefix search: add ^x "pass through" key #36173

Merged
merged 2 commits into from
Jul 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions stdlib/REPL/src/LineEdit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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*" => "*",
Expand Down
7 changes: 7 additions & 0 deletions stdlib/REPL/test/repl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down