From 2a94e57997953c81d39258f4446c43f3f178502c Mon Sep 17 00:00:00 2001 From: ThomasBreuer Date: Tue, 19 Mar 2024 12:21:06 +0100 Subject: [PATCH] fix GAP help access for Julia nightly In Julia 1.12, one can use `default_terminal()` instead of `REPL.TerminalMenus.terminal`. --- src/help.jl | 11 ++++++++++- test/help.jl | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/help.jl b/src/help.jl index a573a264a..01d3eb7f6 100644 --- a/src/help.jl +++ b/src/help.jl @@ -3,8 +3,17 @@ import Markdown import REPL +if isdefined( REPL.TerminalMenus, :default_terminal) + default_terminal = REPL.TerminalMenus.default_terminal +else + # before Julia 1.12 + function default_terminal() + return REPL.TerminalMenus.terminal + end +end + function gap_help_string(topic::String, onlyexact::Bool = false, - term::REPL.Terminals.TTYTerminal = REPL.TerminalMenus.terminal; + term::REPL.Terminals.TTYTerminal = default_terminal(); suppress_output::Bool = false) # Let GAP collect the information. info = Globals.HELP_Info(GapObj(topic), onlyexact) diff --git a/test/help.jl b/test/help.jl index 0b71e6055..08f8e0da2 100644 --- a/test/help.jl +++ b/test/help.jl @@ -1,6 +1,6 @@ @testset "help" begin using GAP.REPL - tt = REPL.TerminalMenus.terminal + tt = GAP.default_terminal() function test_gap_help(topic::String) inp = Base.IOBuffer("qq") # exit the menu if applicable