Skip to content

Conversation

@JDevlieghere
Copy link
Member

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

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 llvm#166610
@llvmbot
Copy link
Member

llvmbot commented Nov 21, 2025

@llvm/pr-subscribers-lldb

Author: Jonas Devlieghere (JDevlieghere)

Changes

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


Full diff: https://github.com/llvm/llvm-project/pull/169101.diff

1 Files Affected:

  • (modified) lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp (+8)
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
index 35a772c1454df..b4e11d20609d0 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -416,6 +416,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());

@github-actions
Copy link

🐧 Linux x64 Test Results

  • 33162 tests passed
  • 495 tests skipped

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[lldb] help(symbol) in lldb's embedded Python interpreter shows an empty screen

2 participants