QTerminal doesn't work as an external terminal for VS Code

When I try to use an external terminal in my Python run configuration on VS Code (I need sudo to run my script), the qterminal/x-terminal-emulator window flashes for a moment then instantly disappears. This problem does not occur when I set VS Code to use gnome-terminal instead. Is there a fix for this?

Here’s my VS Code run configuration:

    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "externalTerminal",
            "redirectOutput": true,
            "sudo" : true,
            "justMyCode" : false

I’m on Lubuntu LTS:
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.