From 09c9dc5e1f822ef77928b5cc240d5ba1e50bec0e Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki Date: Fri, 24 Jul 2020 21:23:46 +0900 Subject: [PATCH] fix errors on v1.6 - xref: https://github.com/JuliaLang/julia/pull/36689 --- src/repl.jl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/repl.jl b/src/repl.jl index d23cdcb..fcd7045 100644 --- a/src/repl.jl +++ b/src/repl.jl @@ -47,7 +47,12 @@ function rewrite_with_ANSI(s, cursormove::Bool = false) l = textwidth(get_prompt(s)) if !isa(s, LineEdit.SearchState) - LineEdit.write_prompt(termbuf, mode) + # xref: https://github.com/JuliaLang/julia/pull/36689 + @static if VERSION ≥ v"1.6.0-DEV.531" + LineEdit.write_prompt(termbuf, mode, LineEdit.hascolor(terminal(s))) + else + LineEdit.write_prompt(termbuf, mode) + end LineEdit.write(termbuf, "\e[0m") # Reset any formatting from Julia so that we start with a clean slate end