[Lldb-commits] [lldb] 28a4ad5 - [lldb] Fix help/pydoc output when the statusline is enabled (#169101)

via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 30 13:59:19 PDT 2026


Author: Jonas Devlieghere
Date: 2026-04-30T13:59:15-07:00
New Revision: 28a4ad535fe5e14f4fdac4f524df76e7f2159993

URL: https://github.com/llvm/llvm-project/commit/28a4ad535fe5e14f4fdac4f524df76e7f2159993
DIFF: https://github.com/llvm/llvm-project/commit/28a4ad535fe5e14f4fdac4f524df76e7f2159993.diff

LOG: [lldb] Fix help/pydoc output when the statusline is enabled (#169101)

Using Python's built-in help shows an empty screen when the statusline
is enabled. The issue is the pydoc pager (e.g. less) which doesn't play
nice with the statusline. Use the "plain" pager instead.

I considered making this conditional on the statusline, but to do that
right you would need to register a callback that toggles it every time
the setting changes and that doesn't seem worth the complexity.

Fixes #166610

Added: 
    

Modified: 
    lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
index 92fb2017dad54..355f18682dd2b 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -426,6 +426,14 @@ ScriptInterpreterPythonImpl::ScriptInterpreterPythonImpl(Debugger &debugger)
   RunSimpleString(run_string.GetData());
   run_string.Clear();
 
+  // Configure pydoc (built-in module) to use the "plain" pager. The default one
+  // doesn't play nice with the statusline.
+  run_string.Printf("run_one_line (%s, 'import pydoc; pydoc.pager = "
+                    "pydoc.plainpager')",
+                    m_dictionary_name.c_str());
+  RunSimpleString(run_string.GetData());
+  run_string.Clear();
+
   run_string.Printf("run_one_line (%s, 'lldb.debugger_unique_id = %" PRIu64
                     "')",
                     m_dictionary_name.c_str(), m_debugger.GetID());


        


More information about the lldb-commits mailing list