【问题标题】:timeout error when using external terminal in Manjaro在 Manjaro 中使用外部终端时出现超时错误
【发布时间】:2019-07-06 06:18:37
【问题描述】:

我已经在 Linux Manjaro 中安装了带有 Python 扩展的 Visual Studio Code。当我尝试启动 Python 脚本时,外部终端会打开,但 5 秒后我在一个窗口中收到一条错误消息,告诉我“超时”并且我的脚本没有启动。

我看到this 在 Windows 10 上发布了同样的问题,但修复似乎不适用于 Manjaro。有什么想法吗?

这是我的 launch.json 文件

{
// 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 (Integrated Terminal)",
        "type": "python",
        "request": "launch",
        "program": "${file}",
        "console": "integratedTerminal"
    },
    {
        "name": "Python: Remote Attach",
        "type": "python",
        "request": "attach",
        "port": 5678,
        "host": "localhost",
        "pathMappings": [
            {
                "localRoot": "${workspaceFolder}",
                "remoteRoot": "."
            }
        ]
    },
    {
        "name": "Python: Module",
        "type": "python",
        "request": "launch",
        "module": "enter-your-module-name-here",
        "console": "integratedTerminal"
    },
    {
        "name": "Python: Django",
        "type": "python",
        "request": "launch",
        "program": "${workspaceFolder}/IA_TD2.py",
        "console": "integratedTerminal",
        "args": [
            "runserver",
            "--noreload",
            "--nothreading"
        ],
        "django": true
    },
    {
        "name": "Python: Flask",
        "type": "python",
        "request": "launch",
        "module": "flask",
        "env": {
            "FLASK_APP": "app.py"
        },
        "args": [
            "run",
            "--no-debugger",
            "--no-reload"
        ],
        "jinja": true
    },
    {
        "name": "Python: Current File (External Terminal)",
        "type": "python",
        "request": "launch",
        "program": "${file}",
        "console": "externalTerminal"
    },
    {
        "name": "Python: Current File (None)",
        "type": "python",
        "request": "launch",
        "program": "${file}",
        "console": "none"
    }
]

}

【问题讨论】:

  • 能否请您显示您的launch.json 中的条目?也许您想尝试将"console" 切换为"integratedTerminal""none"。你在 Manjaro 中使用的默认终端是什么?
  • 集成终端运行良好,但我更喜欢在外部终端中运行。我尝试使用 xterm 和 konsole。它们都产生相同的错误。
  • 也许你应该看看this。似乎 vscode 与每个终端都不兼容。您使用的是哪种桌面环境?我正在使用 Gnome,并且使用外部终端进行调试工作正常。
  • 我正在使用 KDE。非常感谢您的回答。我想我必须尝试其他终端。你有什么建议吗?

标签: python linux visual-studio-code kde manjaro


【解决方案1】:

不幸的是,VSCode 并不兼容所有终端,而且它似乎(还)不兼容您的 Linux Manjaro 安装与 KDE 桌面环境

切换到另一个终端肯定会解决这个问题(即 GNOME 终端)。我不确定gnome-terminal 软件包是否可以在不安装GNOME 桌面环境 的情况下使用。

Here 是一个很好的解决方案,您无需重新安装整个操作系统即可做到这一点。

【讨论】:

  • 我从 manjaro 的额外存储库安装了 gnome-terminal,它运行良好,无需更改桌面环境。感谢您解决问题。
猜你喜欢
  • 1970-01-01
  • 2021-11-27
  • 2020-01-28
  • 2018-11-27
  • 1970-01-01
  • 1970-01-01
  • 2021-09-25
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多