blender_vscode icon indicating copy to clipboard operation
blender_vscode copied to clipboard

Blender not starting from vscode integrated terminal

Open albop opened this issue 3 years ago • 3 comments

I'm on Ubuntu 20.04 in the default wayland session, with Blender 2.82 installed via apt (same result with a snap), and vscode-insiders 1.50 . When running command "Blender Start", I get

> Executing task: /usr/bin/blender --python /home/pablo/.vscode-insiders/extensions/jacqueslucke.blender-development-0.0.12/pythonFiles/launch.py <

Unable to open a display

Terminal will be reused by tasks, press any key to close it.

Pasting the command in a regular system terminal does launch Blender.

On the other hand pasting the command "blender --python" in the vscode terminal already raises the same error "Unable to open a display"

albop avatar Oct 04 '20 09:10 albop

If even blender --python exits with this error in the normal terminal, I don't know what I can do about it unfortunately...

That might be a bug in Blender, because you can reproduce it without vscode.

JacquesLucke avatar Oct 04 '20 09:10 JacquesLucke

Sorry, maybe I wasn't super clear. It does work from a system terminal but not from vscode's terminal which is used by your extension. The error message makes me think complicated (for me) X11/wayland access right. I"m trying several combinations (server, video driver) to see whether I can provide better information.

albop avatar Oct 04 '20 10:10 albop

Small update:

  • I get the same bug inside a Wayland or an X11 session
  • It seems that the DISPLAY property is not set up properly within the integrated terminal. I have a workaround for my machine: I've added to settings.json
    "terminal.integrated.env.linux": {
        "DISPLAY": ":0"
    }

and then blender launches just fine. I assume it is not the right way to fix it though. Some graphical applications seem to start just fine from the integrated-terminal, some don't.

albop avatar Oct 04 '20 12:10 albop