[all-commits] [llvm/llvm-project] 9c54c8: [lldb][gdb-remote] Forward client terminal size to...

Charles Zablit via All-commits all-commits at lists.llvm.org
Tue Jun 9 06:39:00 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9c54c82d80271c326535f73064a8763d0c730a59
      https://github.com/llvm/llvm-project/commit/9c54c82d80271c326535f73064a8763d0c730a59
  Author: Charles Zablit <c_zablit at apple.com>
  Date:   2026-06-09 (Tue, 09 Jun 2026)

  Changed paths:
    M lldb/docs/resources/lldbgdbremote.md
    M lldb/include/lldb/Host/ProcessLaunchInfo.h
    M lldb/include/lldb/Host/windows/PseudoConsole.h
    M lldb/include/lldb/Utility/StringExtractorGDBRemote.h
    M lldb/source/Host/common/ProcessLaunchInfo.cpp
    M lldb/source/Host/windows/PseudoConsole.cpp
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
    M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h
    M lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
    M lldb/source/Utility/StringExtractorGDBRemote.cpp

  Log Message:
  -----------
  [lldb][gdb-remote] Forward client terminal size to lldb-server (#201141)

Add a new gdb-remote packet, `QSetSTDIOWindowSize:cols=N;rows=N`, to
send the dimension of the terminal to the debuggee.

On Windows, the ConPTY emulates a PTY. The client's terminal (the one
the user is running lldb from) has to match the dimensions of the ConPTY
so that the debuggee (which is attached to the ConPTY) gets proper
terminal emulation. If there is a mismatch, lines will not wrap at the
right column and VT sequences will be out of place. In practice, in
lldb, this results in the `(lldb)` prompt being overwritten by the
stdout of the debuggee.

This patch forwards the dimension of the client (the terminal lldb.exe
is running in) to the ConPTY (opened by the server) so that the
dimensions of the client's terminal match the ones of the ConPTY.

As an example, here is the opposite case where the terminal does not
have dimensions (the vscode debug console) and the ConPTY still has
finite dimensions: https://github.com/llvm/llvm-project/pull/186472.

This is a follow up to:
- https://github.com/llvm/llvm-project/pull/201124



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