<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/62338>62338</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[lldb-vscode] Delayed text output to the terminal (Windows)
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
d-mozulyov
</td>
</tr>
</table>
<pre>
### Problem
The lldb-vscode debugger on Windows launches the application in an external window (read more [here](https://github.com/llvm/llvm-project/issues/62336)). The problem is that when debugging, the terminal state is not updated - the text appears with a huge delay. At the same time, the gdb and CodeLLDB debuggers work correctly.
The second problem is that the text is displayed in the DEBUG CONSOLE tab and how it happens. After printf(), nothing appears, but after cout, everything is displayed. But I would like to point out that duplicating the terminal stream in DEBUG CONSOLE is pointless and confusing. Most likely there we need to display important messages of the LLDB itself. Maximum - cerr messages.
![empty_screen](https://user-images.githubusercontent.com/10961593/234129604-780644ea-7df6-49e3-a1db-9f07c7706b98.png)
### Build lldb-vscode for Windows
1. Download [lldb-vscode-bug.zip](https://github.com/llvm/llvm-project/files/11314121/lldb-vscode-bug.zip) and extract it to a local directory, for example, to `C:\LLDBfix`
2. Clone LLVM 16.0.2 into the sources folder by running the `clone.ps1` script (preferably using a modern version of [PowerShell](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.3))
3. Install an up-to-date C++ compiler for Windows (for example, you can unpack the [winlibs archive](https://github.com/brechtsanders/winlibs_mingw/releases/download/12.2.0-16.0.0-10.0.0-ucrt-r5/winlibs-x86_64-posix-seh-gcc-12.2.0-llvm-16.0.0-mingw-w64ucrt-10.0.0-r5.zip) and add the path to the `bin` directory to `PATH`)
4. Build lldb-vscode for Windows by running the `build-lldb.ps1` script
### Reproducing the problem
1. Install Node.js modules into the local directory (for example, to `C:\LLDBfix`): `npm install `
2. Run VSCode in the directory
3. Run "Extension" launch
4. Set a breakpoint on line 7 of `sample.cpp`
5. Run "Debug" launch in target sample project
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVl-P27gR_zT0y0CCRNmy9eCH9TpuD0jugsv1-hhQ5EjihSIF_lnb-fQFKdnrbLYt0AKLlUHO__n9hsOck71G3JPNgWyOKxb8YOxeZKP5HtTVvKxaI657Qqv5Dz5b0yocSXEkxdP8_48BQSnRZi-OG4EgsA19jxaMhn9KLczZgWJB8wEd-AGBTZOSnHlpNEgNTANePFrNFJyTPBC6s8gEjMYikM1hQItkcyR0N3g_OVI9EXoi9NRLP4Q252Yk9KTUy-2TTdb8hdwTepLOBXSEnmpaVTWhDaFNDjHmaU4FZIyKeTgPqJfgpe4JfU7BerSjjKE5zzxGYW08hEkwjwKyRebiY1bIrIOz9AMwGEIfS6HYNYcnn8QcGxG8HPFmuxctMC3g2Qj8-PF4uJfOwdnYb8CNtci9uuZv6-2QGy1-SuEejHQgpJsUu6KINY4Xxw-Hf_wNnn_79ctvHz-AZ7PvwZxBehhi-Nrl8NR5tDBZqX1H6C4V7DnmPEjd35KMR23wwJIwN8HHE3xBe53lHv3ncAgefoGzCUqAkt8QvIHJSO3BBD9HLsKCCd2_LbtFNsYcfoxfutmEQudSItzoLjip-xw-GeeTI3WNxizCGUEjiuh4iQvkOBnrmfYwonOsRwemS75TK6R3qLocPrGLHMMIGXC09i77Q0cILcnmgOPkr18dt4j6PbAGhzaTY9KegRtPuNEetV8wXBZNXW6aitATrdYlbepinW13Rb1eI8u2oquzdYNVxkrRZk1XbPl2W9Rts8unCNnmx6hupD0EGSv_wNHO2Bs3H1XKHI7mrJVhItLuQSNrQ59_l9P_yMJOqkTCsqzKdUnLJPGzcdqkVuLFW8Z9xKU3wEAZzhQIGclg7DViLSaAFzZOamaTAVIXzzGkzXPsXycvpC7mrGgOz8ro2Ng_P0FZ50VOQWpvZlaaYDk66IwSaKG9gg1a33BI6oJH3XxyJakLcNzKyccBNVns0LJWXSHBDhiMRqDV8ILW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