简体   繁体   中英

Visual Studio Code, PowerShell, and Git Bash

I have been trying to configure VSCode to use GitBash as the integrated terminal. However no mater what I try the integrated terminal always shows up as PowerShell. I have disable PowerShell, uninstall Windows Terminal, and Windows Terminal Preview. Here is my settings.json:

{
    "sync.gist": "16ea877040ee819fae27275ae71be30b",
    "sync.quietSync": true,
    "workbench.iconTheme": "material-icon-theme",
    "editor.minimap.enabled": false,
    "workbench.colorCustomizations": {
        "editorGutter.background": "#30208b",
        "statusBar.background": "#1b5c12",
        "statusBar.debuggingBackground": "#1b5c12",
        "statusBar.noFolderBackground": "#1b5c12",
        "statusBar.border": "#ff0000"
    },
    "python.autoComplete.addBrackets": true,
    "python.dataScience.themeMatplotlibPlots": true,
    "python.linting.pylamaEnabled": true,
    "python.linting.pycodestyleEnabled": true,
    "git.autofetch": true,
    "python.pythonPath": "/usr/bin/python3",
    "code-runner.respectShebang": false,
    "code-runner.fileDirectoryAsCwd": true,
    "code-runner.runInTerminal": true,
    "editor.fontSize": 12,
    "editor.fontFamily": "'Aurulent Sans Mono Regular','Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'",
    "editor.formatOnSave": true,
    "editor.formatOnType": true,
    "editor.formatOnPaste": true,
    "prettier.printWidth": 120,
    "prettier.singleQuote": true,
    "prettier.tabWidth": 4,
    "prettier.jsxSingleQuote": true,
    "prettier.jsxBracketSameLine": true,
    "browser-preview.startUrl": "http://127.0.0.1:8000/",
    "browser-preview.verbose": false,
    "python.linting.pylintArgs": ["--extension-pkg-whitelist=PyQt5"],
    "[python]": {
        "editor.defaultFormatter": "iansan5653.format-python-docstrings"
    },
    "explorer.confirmDragAndDrop": false,
    "explorer.confirmDelete": false,
    "git.enableSmartCommit": true,
    "files.associations": {
        "**/*.html": "html",
        "**/templates/**/*.html": "django-html",
        "**/templates/**/*": "django-txt",
        "**/requirements{/**,*}.{txt,in}": "pip-requirements"
    },
    "terminal.integrated.fontFamily": "'Fira Code Medium'",
    "terminal.integrated.fontSize": 12,
    "terminal.integrated.inheritEnv": true,
    "#terminal.integrated.defaultProfile.osx#": "C:\\Windows\\System32\\cmd.exe",
    "#terminal.integrated.defaultProfile.windows": "C:\\Windows\\System32\\cmd.exe",
    "terminal.integrated.cwd": "C:\\Users\\DawsonSchaffer\\Documents\\Projects",
    "workbench.colorTheme": "Monokai",
    "workbench.editorAssociations": [

        {
            "viewType": "jupyter.notebook.ipynb",
            "filenamePattern": "*.ipynb"
        }
    ],
    "terminal.integrated.profiles.windows": {
        "Git Bash": {
            "source": "Git Bash",
            "path": "C:\\Program Files\\Git\\git-bash.exe",
        }
    },
    "terminal.integrated.defaultProfile.windows": "Git Bash",
    "python.analysis.completeFunctionParens": true,
    "settingsSync.ignoredSettings": [
        "terminal.external.windowsExec"
    ],
    "terminal.explorerKind": "external",
}

Any help in finding a solution for this would be greatly appreciated.

Thanks Dawson

As a temporary workaround you may use the deprecated setting: "terminal.integrated.shell.windows": "C:\Program Files\Git\bin\bash.exe"

I finally got it working using the following:

"terminal.integrated.profiles.windows": {
    "Git Bash": {
        "source": "Git Bash",
        "path": "C:\\Program Files\\Git\\git-bash.exe",
        "icon": "C:\\Program Files\\gitbash.png"
    }
},
"terminal.integrated.defaultProfile.windows": "Git Bash",

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM