vscode-rdbg icon indicating copy to clipboard operation
vscode-rdbg copied to clipboard

WSL, Can't attach with rdbg: "your 131072x1 screen size is bogus, expect trouble"

Open Leo137 opened this issue 3 years ago • 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

Leo137 avatar Sep 01 '22 15:09 Leo137

Wow. I'm using WSL and I never see the error. How to repro? Need to buy a big display :p ?

ko1 avatar Sep 16 '22 08:09 ko1

Haha 😅 Nothing much interesting is done. Here's a screencast of the flow:

https://user-images.githubusercontent.com/4783831/191789953-2247cdbb-b42a-4318-b9e1-98a9afa887f0.mp4

Leo137 avatar Sep 22 '22 15:09 Leo137

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.

Leo137 avatar Sep 22 '22 16:09 Leo137

Ah, do you reuse .vscode/ created by rdbg -n --open=vscode?

ko1 avatar Oct 04 '22 08:10 ko1

I ran into the exact same problem last night with my WSL2 setup.

Code_LzFdxQJWxS

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:

Code_eDFoW62iTT

Then, click the "Attach with rdbg" button hiding in the top left of the VS Code UI:

Code_YJ49vaEIf9

Now, you can place a breakpoint in your code by clicking in the gutter, left of the line number:

Code_s2jbSjMQ6J

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!

leastbad avatar Dec 23 '22 20:12 leastbad