[Lldb-commits] [lldb] 3edae0d - [lldb] Use EL_REFRESH to refresh Editline
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Tue Jul 1 11:08:15 PDT 2025
Author: Jonas Devlieghere
Date: 2025-07-01T11:08:11-07:00
New Revision: 3edae0d5e5b69a4613a0dfce32ef56eb3ffec2fb
URL: https://github.com/llvm/llvm-project/commit/3edae0d5e5b69a4613a0dfce32ef56eb3ffec2fb
DIFF: https://github.com/llvm/llvm-project/commit/3edae0d5e5b69a4613a0dfce32ef56eb3ffec2fb.diff
LOG: [lldb] Use EL_REFRESH to refresh Editline
Letting Editline refresh itself is more robust and ensures that the
current text is redraw if it was accidentally cleared. In that scenario
MoveCursor would only fix up the cursor position.
Added:
Modified:
lldb/source/Host/common/Editline.cpp
lldb/test/API/functionalities/statusline/TestStatusline.py
Removed:
################################################################################
diff --git a/lldb/source/Host/common/Editline.cpp b/lldb/source/Host/common/Editline.cpp
index 4720d3b4c29ac..5ed30fbb231d8 100644
--- a/lldb/source/Host/common/Editline.cpp
+++ b/lldb/source/Host/common/Editline.cpp
@@ -1713,7 +1713,7 @@ void Editline::Refresh() {
if (!m_editline || !m_output_stream_sp)
return;
LockedStreamFile locked_stream = m_output_stream_sp->Lock();
- MoveCursor(CursorLocation::EditingCursor, CursorLocation::EditingCursor);
+ el_set(m_editline, EL_REFRESH);
}
bool Editline::CompleteCharacter(char ch, EditLineGetCharType &out) {
diff --git a/lldb/test/API/functionalities/statusline/TestStatusline.py b/lldb/test/API/functionalities/statusline/TestStatusline.py
index e2c2ed548ed0e..ca2f10820d56d 100644
--- a/lldb/test/API/functionalities/statusline/TestStatusline.py
+++ b/lldb/test/API/functionalities/statusline/TestStatusline.py
@@ -114,8 +114,6 @@ def test_resize(self):
self.resize()
self.expect("set set show-statusline true", ["no target"])
self.resize(20, 60)
- # Check for the newline followed by the escape code to move the cursor
- # up one line.
- self.child.expect(re.escape("\n\x1b[1A"))
- # Check for the escape code to move the cursor back to column 8.
- self.child.expect(re.escape("\x1b[8G"))
+ # Check for the escape code to resize the scroll window, followed by
+ # the prompt.
+ self.child.expect(re.escape("\x1b[1;19r\x1b8(lldb)"))
More information about the lldb-commits
mailing list