[all-commits] [llvm/llvm-project] 1eb795: [lldb] Correctly restore the cursor column after r...

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Mon Jun 30 14:34:57 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1eb795413df3c38b688d42d6595a8e1503f6d139
      https://github.com/llvm/llvm-project/commit/1eb795413df3c38b688d42d6595a8e1503f6d139
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2025-06-30 (Mon, 30 Jun 2025)

  Changed paths:
    M lldb/include/lldb/Core/Debugger.h
    M lldb/include/lldb/Core/IOHandler.h
    M lldb/include/lldb/Host/Editline.h
    M lldb/source/Core/Debugger.cpp
    M lldb/source/Core/IOHandler.cpp
    M lldb/source/Core/Statusline.cpp
    M lldb/source/Host/common/Editline.cpp
    M lldb/test/API/functionalities/statusline/TestStatusline.py

  Log Message:
  -----------
  [lldb] Correctly restore the cursor column after resizing the statusline (#146132)

This PR ensures we correctly restore the cursor column after resizing
the statusline. To ensure we have space for the statusline, we have to
emit a newline to move up everything on screen. The newline causes the
cursor to move to the start of the next line, which needs to be undone.

Normally, we would use escape codes to save & restore the cursor
position, but that doesn't work here, as the cursor position may have
(purposely) changed. Instead, we move the cursor up one line using an
escape code, but we weren't restoring the column.

Interestingly, Editline was able to recover from this issue through the
LineInfo struct which contains the buffer and the cursor location, which
allows us to compute the column. This PR addresses the bug by having
Editline "refresh" the cursor position.

Fixes #134064



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list