如何配置VS代码以使用Cmder?

2024-09-30 01:33:43 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用VS code作为Python(Python环境)的IDE。因此,我将cmder配置为我的终端,并尝试通过单击run按钮(绿色三角形)来测试一个简单的print语句。我得到了以下错误:

enter image description here

我的JSON设置如下所示:

   {
    "terminal.integrated.shell.windows": "Cmder.exe",
    "terminal.integrated.env.windows": {
        "CMDER_ROOT": "C:\\Users\\EK\\Cmder.exe"
    },
    "terminal.integrated.shellArgs.windows": [
        "/k",
        "%CMDER_ROOT%\\vendor\\bin\\vscode_init.Cmder"
    ],
    "python.pythonPath": "C:\\ProgramData\\Anaconda3\\python.exe",
    "atomKeymap.promptV3Features": true,
    "editor.multiCursorModifier": "ctrlCmd",
    "editor.formatOnPaste": true,
    "kite.showWelcomeNotificationOnStartup": false,
    "workbench.colorCustomizations": {
        "terminal.background": "#1D2021",
        "terminal.foreground": "#09c0f8",
        "terminalCursor.background": "#A89984",
        "terminalCursor.foreground": "#A89984",
        "terminal.ansiBlack": "#1D2021",
        "terminal.ansiBlue": "#0D6678",
        "terminal.ansiBrightBlack": "#665C54",
        "terminal.ansiBrightBlue": "#0D6678",
        "terminal.ansiBrightCyan": "#8BA59B",
        "terminal.ansiBrightGreen": "#95C085",
        "terminal.ansiBrightMagenta": "#8F4673",
        "terminal.ansiBrightRed": "#FB543F",
        "terminal.ansiBrightWhite": "#FDF4C1",
        "terminal.ansiBrightYellow": "#FAC03B",
        "terminal.ansiCyan": "#fbfdfc",
        "terminal.ansiGreen": "#95C085",
        "terminal.ansiMagenta": "#8F4673",
        "terminal.ansiRed": "#FB543F",
        "terminal.ansiWhite": "#A89984",
        "terminal.ansiYellow": "#FAC03B"
    },
    "workbench.colorTheme": "Monokai Dimmed",
    "workbench.editor.decorations.colors": true,
    "workbench.preferredHighContrastColorTheme": "Visual Studio Light",
    "python.formatting.provider": "none",
    "terminal.integrated.automationShell.linux": "",
    "terminal.integrated.scrollback": 100000,
    "workbench.editorAssociations": [
        {
            "viewType": "jupyter.notebook.ipynb",
            "filenamePattern": "*.ipynb"
        }
    ],
    "terminal.integrated.env.windows": {}
}

我不知道为什么事情会出错?有人能帮我吗


Tags: envtruewindowsexeterminaleditorbackgroundforeground
1条回答
网友
1楼 · 发布于 2024-09-30 01:33:43

请找到“cmder”可执行文件的绝对路径,并在“settings.json”中使用此路径:

enter image description here

“settings.json”:

"terminal.integrated.shell.windows": "..:\\cmder\\Cmder.exe",

运行:

enter image description here

此外,请检查“cmder”终端是否可以在VS代码之外使用

参考资料:Integrated Terminal in VS Code

相关问题 更多 >

    热门问题