Skip to content

Commit

Permalink
Merge pull request #20494 from JuliaLang/sk/shellmode
Browse files Browse the repository at this point in the history
eliminate REPL shell mode deprecation warnings
  • Loading branch information
StefanKarpinski authored Feb 8, 2017
2 parents 407985b + 35aa4f1 commit b8c21cf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion base/REPL.jl
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ 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), macroexpand(Expr(:macrocall, Symbol("@cmd"),line)), outstream(repl))
Expr(:call, :(Base.repl_cmd), Cmd(Base.shell_split(line)), outstream(repl))
end)


Expand Down
2 changes: 1 addition & 1 deletion base/shell.jl
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ end

function shell_split(s::AbstractString)
parsed = shell_parse(s, false)[1]
args = AbstractString[]
args = String[]
for arg in parsed
push!(args, string(arg...))
end
Expand Down
7 changes: 7 additions & 0 deletions test/repl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ if !is_windows() || Sys.windows_version() >= Sys.WINDOWS_VISTA_VER
end
cd(origpwd)

# issue #20482
write(stdin_write, ";")
readuntil(stdout_read, "shell> ")
write(stdin_write, "echo hello >/dev/null\n")
readuntil(stdout_read, "\n")
readuntil(stdout_read, "\n")

# Test that accepting a REPL result immediately shows up, not
# just on the next keystroke
write(stdin_write, "1+1\n") # populate history with a trivial input
Expand Down

0 comments on commit b8c21cf

Please sign in to comment.