[Lldb-commits] [lldb] [lldb] Correct use_editline check in IOHandlerEditline (PR #171733)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Thu Dec 11 09:22:38 PST 2025
================
@@ -245,8 +245,10 @@ IOHandlerEditline::IOHandlerEditline(
SetPrompt(prompt);
#if LLDB_ENABLE_LIBEDIT
- const bool use_editline = m_input_sp && m_output_sp && m_error_sp &&
- m_input_sp->GetIsRealTerminal();
+ const bool use_editline =
+ m_input_sp && m_input_sp->GetIsRealTerminal() && // Input
+ m_output_sp && m_output_sp->GetUnlockedFile().GetStream() && // Output
+ m_error_sp && m_error_sp->GetUnlockedFile().GetStream(); // Error
----------------
JDevlieghere wrote:
Added a comment. I kept it slightly more generic than what you're suggesting here as I don't want to codify which files have a FILE*. We have a similar comment in the `File` class, saying that not all files have `FILE*`. The bug report includes an example that goes through the Python read/write APIs.
https://github.com/llvm/llvm-project/pull/171733
More information about the lldb-commits
mailing list