Skip to content

Commit 4ac32e9

Browse files
committed
Fix Cthulhu.jl#541, catch IOError when using REPL.Terminals.raw!
Fix JuliaDebug/Cthulhu.jl#541 This allows Cthulhu.jl to precompile with Julia release-1.11 branch.
1 parent aecd8fd commit 4ac32e9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

stdlib/REPL/src/TerminalMenus/AbstractMenu.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,14 @@ function request(term::REPL.Terminals.TTYTerminal, m::AbstractMenu; cursor::Unio
238238
finally # always disable raw mode
239239
if raw_mode_enabled
240240
!suppress_output && print(term.out_stream, "\x1b[?25h") # unhide cursor
241-
REPL.Terminals.raw!(term, false)
241+
try
242+
# raw! calls check_open which can throw
243+
REPL.Terminals.raw!(term, false)
244+
catch err
245+
if err !== Base.IOError("stream is closed or unusable", 0)
246+
rethrow()
247+
end
248+
end
242249
end
243250
end
244251
!suppress_output && println(term.out_stream)

0 commit comments

Comments
 (0)