Skip to content
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
6 changes: 5 additions & 1 deletion src/CthulhuBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,11 @@ function __descend_with_error_handling(args...; terminal=default_terminal(), kwa
return nothing
end

default_terminal() = REPL.LineEdit.terminal(Base.active_repl)
function default_terminal()
term_env = get(ENV, "TERM", @static Sys.iswindows() ? "" : "dumb")
term = REPL.Terminals.TTYTerminal(term_env, stdin, stdout, stderr)
return term
end

descend_impl(@nospecialize(args...); kwargs...) =
_descend_with_error_handling(args...; iswarn=true, kwargs...)
Expand Down
4 changes: 1 addition & 3 deletions test/test_terminal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ macro with_try_stderr(out, expr)
end

@testset "Terminal" begin
if isdefined(Base, :active_repl)
@test Cthulhu.default_terminal() isa REPL.Terminals.TTYTerminal
end
@test Cthulhu.default_terminal() isa REPL.Terminals.TTYTerminal
colorize(use_color::Bool, c::Char) = Cthulhu.stringify() do io
use_color ? printstyled(io, c; color=:cyan) : print(io, c)
end
Expand Down