Skip to content

Commit

Permalink
Merge pull request #99 from tkelman/specific-redirects
Browse files Browse the repository at this point in the history
Show any unexpected stderr output during __init__
  • Loading branch information
KristofferC authored Aug 21, 2017
2 parents e4b8da0 + 10d0240 commit 6b873e7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/OhMyREPL.jl
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,20 @@ function __init__()
end
end

mktemp() do _, f
mktemp() do file, io
old_stderr = STDERR
redirect_stderr(f)
redirect_stderr(io)
Base.LineEdit.refresh_line(s) = (Base.LineEdit.refresh_multi_line(s); OhMyREPL.Prompt.rewrite_with_ANSI(s))
include(joinpath(@__DIR__, "output_prompt_overwrite.jl"))
include(joinpath(@__DIR__, "MarkdownHighlighter.jl"))
redirect_stderr(old_stderr)
seek(io, 0)
for line in eachline(io)
if !ismatch(Regex("^WARNING: Method definition [refresh_line|display|term]" *
".* overwritten in module .* at $(escape_string(@__DIR__)).*\$"), line)
println(line)
end
end
end
end

Expand Down

0 comments on commit 6b873e7

Please sign in to comment.