-
Notifications
You must be signed in to change notification settings - Fork 38.2k
Description
Does this issue occur when all extensions are disabled?: No
You will need extensions for this to work (codeLLDB in my case to start a debugging session)
- VS Code Version: 1.97.2 (1.96.0-1.98.0)
- OS Version: macOS 15.3
When i use the debugger (codeLLDB in this case) and i press F5, everything is fine. but when i keep the debug terminal open and i click F5 again after the first debugging session is done, it puts in "c" or "cl" before the LLDB attach command in the terminal and gives an error and doesn't start debugging.
if i close the debug terminal tab and then start the debugger with F5 again it works like expected. it's only when re-running the debugger while the old debug screen is still there.
if i disable the Clear before reusing setting, it will work like expected.
"c" and "cl" are also the first few letters of "clear" so i suspect something is going on with that. (ive searched the github repo and found this, it sends "clear" to the terminal, but it prob isn't able to finish sending it to the terminal so it bugs)
vscode/src/vs/workbench/api/node/extHostDebugService.ts
Lines 160 to 171 in a948ee5
| if (configProvider.getConfiguration('debug.terminal').get<boolean>('clearBeforeReusing')) { | |
| // clear terminal before reusing it | |
| if (shell.indexOf('powershell') >= 0 || shell.indexOf('pwsh') >= 0 || shell.indexOf('cmd.exe') >= 0) { | |
| terminal.sendText('cls'); | |
| } else if (shell.indexOf('bash') >= 0) { | |
| terminal.sendText('clear'); | |
| } else if (platform.isWindows) { | |
| terminal.sendText('cls'); | |
| } else { | |
| terminal.sendText('clear'); | |
| } | |
| } |
Steps to Reproduce:
my launch.json:
{
"name": "Debug A0 Hello",
"type": "lldb",
"env": {
"ASAN_OPTIONS": "detect_leaks=0"
},
"request": "launch",
"program": "a0-hello",
"cwd": "${workspaceFolder}",
"stopOnEntry": false,
"preLaunchTask": "Build A0 Hello"
},- go to settings > Debug › Terminal: Clear Before Reusing and turn it ON
- now start the debugger F5. (without any breakpoints, so it should finish)
- start the debugger again without closing the Debug tab in the terminal and there should be a random "c" or "cl" (or something else) before the debugger command and fail to run.
- (you will also have to force quit CodeLLDB and reload vs code in order to stop the process.)
i have found some other issues and things online referencing similar problems, but those are all "resolved" or "closed" etc:
- Unknown characters were output in the built-in terminal. vscode-python-debugger#302 (comment) (same thing but marked as closed due to it being a "vs code" issue and not a python debugger issue)
- Clear terminal before launching another debuggee in terminal #116699 (the issue that led to the code referenced above being added)