diff --git a/base/REPL.jl b/base/REPL.jl index 79a3ed861acb8e..ff631624b15d5b 100644 --- a/base/REPL.jl +++ b/base/REPL.jl @@ -750,7 +750,9 @@ function setup_interface(repl::LineEditREPL; hascolor = repl.hascolor, extra_rep # and pass into Base.repl_cmd for processing (handles `ls` and `cd` # special) on_done = respond(repl, julia_prompt) do line - Expr(:call, :(Base.repl_cmd), Cmd(Base.shell_split(line)), outstream(repl)) + Expr(:call, :(Base.repl_cmd), + :(Base.cmd_gen($(Base.shell_parse(line)[1]))), + outstream(repl)) end) diff --git a/base/process.jl b/base/process.jl index ac85813c5f5514..ea421ce4e729f0 100644 --- a/base/process.jl +++ b/base/process.jl @@ -817,7 +817,7 @@ function cmd_gen(parsed) end macro cmd(str) - return :(cmd_gen($(shell_parse(str, special=shell_special)[1]))) + return :(cmd_gen($(esc(shell_parse(str, special=shell_special)[1])))) end wait(x::Process) = if !process_exited(x); stream_wait(x, x.exitnotify); end diff --git a/base/shell.jl b/base/shell.jl index a6a8d2fddb48ae..841865790b9c9e 100644 --- a/base/shell.jl +++ b/base/shell.jl @@ -75,7 +75,7 @@ function shell_parse(str::AbstractString, interpolate::Bool=true; stpos = j ex, j = parse(s,j,greedy=false) last_parse = stpos:j - update_arg(esc(ex)); i = j + update_arg(ex); i = j else if !in_double_quotes && c == '\'' in_single_quotes = !in_single_quotes