WSL, Can't attach with rdbg: "your 131072x1 screen size is bogus, expect trouble"
Leo137 opened this issue · 5 comments
I'm trying to debug a Remote WSL session using rdbg extension.
When i try to attach the rdbg process into VSCode, i get the following error:
your 131072x1 screen size is bogus. expect trouble
your 131072x1 screen size is bogus. expect trouble
I can't seem to control the size of the terminal that is spawned to run rdbg. So debugging is not feasible
Been looking for fixes in the VSCode repo, and they suggest to ignore this error silently:
VSCode workaround: https://github.com/microsoft/vscode/pull/104277/files
Same workaround, implemented in Omnisharp VSCode extension: https://github.com/OmniSharp/omnisharp-vscode/pull/3961/files
VSCode version: 1.70.2
Using WSL2 with Ubuntu-20.04
Extensions:
Remote - WSL v0.66.3
VSCode rdbg Ruby Debugger v0.0.11
Wow. I'm using WSL and I never see the error. How to repro? Need to buy a big display :p ?
Haha 😅
Nothing much interesting is done.
Here's a screencast of the flow:
Code_2022-09-22_12-32-01.mp4
Okay, i gave it more thought to my attach config.
Added the "debugPort"
configuration and also gave my rdbg process the flags to allow remote debugging in a certain port.
Back then:
rdbg -n --open=vscode
Now:
rdbg -n -O --port=12345
That way, i can debug without issue from vscode using the extension, and the error message dissapears.
Ah, do you reuse .vscode/
created by rdbg -n --open=vscode
?
I ran into the exact same problem last night with my WSL2 setup.
It seems to randomly afflict different folks working with different Linux distros and tooling.
@Leo137 I appreciate your detective work, although you didn't provide literal steps. I'm going to share my configs exactly so that the next people coming along might suffer less in their journey.
Note that your paths and Ruby versions will certainly be different, future traveller. Here is my .vscode/launch.json
:
{
"version": "0.2.0",
"configurations": [
{
"type": "rdbg",
"name": "Attach with rdbg",
"request": "attach",
"rdbgPath": "/home/leastbad/.rvm/gems/ruby-3.1.3/gems/debug-1.7.1/exe/rdbg",
"debugPort": "20138",
"localfs": true
}
]
}
And my Procfile.dev
:
web: rdbg -n -O --port=20138 -c -- bin/rails server -p 3000
js: yarn build --watch
I'm using esbuild
and foreman/overmind, and so far as I can tell, the port is arbitrary so long as it's available.
Order of operations is that you run bin/dev
in your VS Code terminal first:
Then, click the "Attach with rdbg" button hiding in the top left of the VS Code UI:
Now, you can place a breakpoint in your code by clicking in the gutter, left of the line number:
Finally, hit the route in your browser and you should be in business.
Pretty cool! I'm still a passionate Ruby Jard user, but I'm going to give this whole IDE thing an honest try. I haven't used an IDE workflow since VB6!