From 812d645601460931e40032e7d1606854ad140614 Mon Sep 17 00:00:00 2001 From: Robert Blackhart Date: Tue, 14 Apr 2026 19:03:39 -0400 Subject: [PATCH 1/3] Apply suggested fix to recline/repl/shell.py from Copilot Autofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --- recline/repl/shell.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/recline/repl/shell.py b/recline/repl/shell.py index 310e438..57c3c4d 100644 --- a/recline/repl/shell.py +++ b/recline/repl/shell.py @@ -302,7 +302,11 @@ def setup_tab_complete() -> None: # libedit (default for macos) implements this but never calls it (broken) readline.set_completion_display_matches_hook(completer.match_command_hook) readline.set_completer(completer.CommandCompleter(commands.COMMAND_REGISTRY).completer) - if readline.__doc__ and "libedit" in readline.__doc__: + # Heuristic backend detection: libedit is typically advertised in the module docstring. + # Keep this centralized and defensive to avoid direct fragile checks. + readline_doc = getattr(readline, "__doc__", "") or "" + is_libedit = "libedit" in readline_doc.lower() + if is_libedit: # macos doesn't use GNU readline, but BSD libedit instead readline.parse_and_bind("bind '\t' rl_complete") readline.parse_and_bind("bind '^R' em-inc-search-prev") From f001164735152afad23031638f19b9d50543bc97 Mon Sep 17 00:00:00 2001 From: Robert Blackhart Date: Tue, 14 Apr 2026 19:03:39 -0400 Subject: [PATCH 2/3] Apply suggested fix to recline/repl/shell.py from Copilot Autofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --- recline/repl/shell.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recline/repl/shell.py b/recline/repl/shell.py index 57c3c4d..1fbdec5 100644 --- a/recline/repl/shell.py +++ b/recline/repl/shell.py @@ -297,7 +297,7 @@ def setup_tab_complete() -> None: """Set up the readline library to hook into our command completer""" readline.set_completer_delims("") - if sys.platform == "linux": + if sys.platform.startswith("linux"): # pyreadline3 (used for windows) doesn't implement this # libedit (default for macos) implements this but never calls it (broken) readline.set_completion_display_matches_hook(completer.match_command_hook) From bc403de097877811df4733572a7cd7e43dc670f2 Mon Sep 17 00:00:00 2001 From: Robert Blackhart Date: Tue, 14 Apr 2026 19:03:40 -0400 Subject: [PATCH 3/3] Apply suggested fix to recline/repl/shell.py from Copilot Autofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --- recline/repl/shell.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recline/repl/shell.py b/recline/repl/shell.py index 1fbdec5..418ade0 100644 --- a/recline/repl/shell.py +++ b/recline/repl/shell.py @@ -72,7 +72,8 @@ def relax( _setup_repl(program_name, prompt, history_file, argv) - if single_command or not repl_mode or argv and len(argv) >= 2 and argv[1] == "-c": + has_dash_c = (argv and len(argv) >= 2 and argv[1] == "-c") + if single_command or not repl_mode or has_dash_c: # Some external process sent us a command to run (like scp or ssh or # so run it and exit command = argv[2:]