<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/134846>134846</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            lldb statusline problems in Windows cmd prompt
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            lldb,
            platform:windows
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          DavidSpickett
      </td>
    </tr>
</table>

<pre>
    I'm replicating the build from https://lab.llvm.org/buildbot/#/builders/141, which is configured with:
```
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLVM_LIT_ARGS=-v -DCMAKE_INSTALL_PREFIX=../install -DLLVM_ENABLE_PROJECTS=lldb;clang;llvm;lld -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DLLDB_TEST_USER_ARGS=--skip-category=watchpoint -DLLDB_ENFORCE_STRICT_TEST_REQUIREMENTS=ON ../llvm-project/llvm
```
(https://lab.llvm.org/buildbot/#/builders/141/builds/7703/steps/3/logs/stdio)

It runs on Windows on Arm, builds with clang, Windows 11 pro 10.0.22631.

This is probably relevant:
```
-- Could NOT find LibEdit (missing: LibEdit_INCLUDE_DIRS LibEdit_LIBRARIES) 
-- Enable editline support in LLDB: FALSE
-- Could NOT find CursesAndPanel (missing: CURSES_INCLUDE_DIRS CURSES_LIBRARIES PANEL_LIBRARIES HAS_TERMINFO_SYMBOLS) 
-- Enable curses support in LLDB: FALSE
```
The resulting build of lldb has many problems with corrupted text, even if I turn off the statusline.

I'm running this in a CMD prompt, which may explain this, if that doesn't support the special characters.

Not sure how to report this, so here's the result of a basic session:
```
C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build>.\bin\lldb.exe C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\lldb-test-build.noindex\commands\expression\expr-from-non-zero-frame\TestExprFromNonZeroFrame.test\a.out
(lldb) target create "C:\\Users\\tcwg\\llvm-worker\\lldb-aarch64-windows\\build\\lldb-test-build.noindex\\commands\\expression\\expr-from-non-zero-frame\\TestExprFromNonZeroFrame.test\\a.out"
Current executable set to 'C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\lldb-test-build.noindex\commands\expression\expr-from-non-zero-frame\TestExprFromNonZeroFrame.test\a.out' (aarch64).
(lldb) b main.c:1
Breakpoint 1: where = a.out`func at main.c:1:18, address = 0x0000000140001000
(lldb) a.out | main.c:1:18 | breakpoint 1.1 c
error: Command requires a current process.
(lldb) run
Process 22088 launched: 'C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\lldb-test-build.noindex\commands\expression\expr-from-non-zero-frame\TestExprFromNonZeroFrame.test\a.out' (aarch64)
(lldb) mint main(int argc, const char *argv[]) { return func(); }
```
Running any new command seems to only update the bottom line and it doesn't scroll the rest up at all. Here I ran a backtrace:
```
(lldb) me #5: 0x00007ffe66655aec ntdll.dll`RtlUserThreadStart + 60+ 480c490) at main.c:3:49
```
But I only get the last line shown.

Quitting lldb seems to leave the terminal in this "single line" state, where everything typed appears on the bottom line only, and is overwritten by output lines. So I wonder if CMD just doesn't support these codes properly.

If I disable the status line:
```
C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build>.\bin\lldb.exe -o "settings set show-statusline false" C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\lldb-test-build.noindex\commands\expression\expr-from-non-zero-frame\TestExprFromNonZeroFrame.test\a.out
(lldb) target create "C:\\Users\\tcwg\\llvm-worker\\lldb-aarch64-windows\\build\\lldb-test-build.noindex\\commands\\expression\\expr-from-non-zero-frame\\TestExprFromNonZeroFrame.test\\a.out"
Current executable set to 'C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\lldb-test-build.noindex\commands\expression\expr-from-non-zero-frame\TestExprFromNonZeroFrame.test\a.out' (aarch64).
(lldb) settings set show-statusline false
(lldb) b main.c:1
a.out << is the status line, but presumably this is left over from when it first started up 
```
And it does get cleared by the next command, but as soon as I run, I'm back into this strange single line state again.

I could try doing this with a `.lldbinit` file but I'm pretty sure that just makes commands run at startup, same as doing it this way.

Another cause could be the lack of editline meaning we can't properly ask the terminal what it supports.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzsWF2P6jgS_TXulxJRcPhoHngIIcxll6Z7gN69sy_IOAXxbcfO2k7T7K9f2QH6a6c10kgrze5cXTWJ45TrVJXPcYVZKw4KcUz6E9Kf3rDGldqMp-xZFOta8Cd07mani9N4TuiwAoO1FJw5oQ7gSoRdI2QBe6MrKJ2rLUlSQmeEziTbRVI-V5E2B0JnYd5Ou_AwuQygsYTOur0uoRkcS8FLEBa4VntxaAwWcBSu9CbjlAzi8_845RV7Quj8BEuhfjDoTLO79K_5dvI4X0y3m18ecpJMVyiRWYTOdLH42912Md9s09VPa5JMO8_XN-bL9SZdLLYPq3w2_06SaRQROhPKOibl5dV8mU4W-fZhdf-XPNt4C1IWO5JMuGTqQJKJhxl-iqvhbJvd3z3MF_lqu0gfl9m3fEWSKeeMl_g66fv3r6ctFtPJdpOvN9vHdb66-t-xT6LucObwoM2JJNMjc7ystVDu8lK-nN2vsny73qzm2aa1scp_fpyv8rt8GUDcLyGg9d53aqN_IHfn2w_hJvT29-W2HfC3w2HsJ1iHtb_111IfbBgqhCZ05NeL07kD0ygLWsHfhSr0MVympvKF0loLtQFtDmh2ndbtQm00dOMojigdJN2otbgphfXFVRu9Yzt5AoMSn5lyn8ur04FMN7KA5f0G9kIVsBC7vBAOCL2thLXCpz29jG7ny2zxOM230_lqfR1czCerdDXP14SOoDWaK7aTCFgIJ4VCsE1da-NAKPBJ8yZn6WKd_0cXssZYtKkqHphC-cGT7HG1ztfvHTmPXf2Ah3SZL97cf0vX202-upsvZ_fb9S93k_vFZ2d5WPYrV99GblMiGLSNDPzQcoPeg98vUDILFVOnkAGJ1SWB2pimdliAwxfnM4nPqEDsYQ6uMQr0fh-YxjrmGusDd87omZAapVo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