March 3, 2019

WindowsのVSCodeでのtasks.jsonとsettings.jsonの設定

いつも忘れるのでメモしておく

tasks.json

{
    "tasks": [
        {
            "label": "Python",
            "args": ["${file}"],
            "type": "shell",
            "command": "${config:python.pythonPath}",
            "problemMatcher": [],
            "isShellCommand": true,
            "options": {
                "env": {
                    "PYTHONIOENCODING": "UTF-8"
                }
            },
            "group": {
                "kind": "build",
                "isDefault": true
            },
        }
    ],    
}

settings.json

{
    "python.pythonPath": "C:\\Users\\gepur\\Anaconda3\\envs\\me\\python.exe",
    "files.autoGuessEncoding": true,
    // "terminal.integrated.shellArgs.windows": ["/K", "chcp 65001"]
    "terminal.integrated.shell.windows": "C:\\Windows\\system32\\cmd.exe",
    "terminal.integrated.shellArgs.windows": [
        "/k",
        "chcp",
        "65001"
    ]
}

© gepuro 2013