Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WRONG $PATH in Integrated terminal. #71914

Closed
ladyrick opened this issue Apr 8, 2019 · 4 comments
Closed

WRONG $PATH in Integrated terminal. #71914

ladyrick opened this issue Apr 8, 2019 · 4 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s)

Comments

@ladyrick
Copy link

ladyrick commented Apr 8, 2019

Issue Type: Bug

See the video below.
https://ladyrick.github.io/

VS Code version: Code 1.33.0 (0dd516d, 2019-04-04T16:15:50.230Z)
OS version: Darwin x64 18.5.0

System Info
Item Value
CPUs Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz (8 x 2700)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
rasterization: enabled
surface_synchronization: enabled_on
video_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 2, 2, 2
Memory (System) 16.00GB (8.01GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (14)
Extension Author (truncated) Version
output-colorizer IBM 0.1.2
prototxt dmi 0.0.6
gitlens eam 9.5.1
todo-tree Gru 0.0.126
latex-workshop Jam 6.3.0
code-beautifier mic 2.2.1
vscode-language-pack-zh-hans MS- 1.33.2
python ms- 2019.3.6352
cpptools ms- 0.22.1
material-icon-theme PKi 3.7.0
code-settings-sync Sha 3.2.8
open-in-browser tec 2.0.0
cmake twx 0.0.17
vscode-proto3 zxh 0.2.2
This is my settings.json
{
    "terminal.integrated.shell.windows": "C:\\msys64\\usr\\bin\\bash.exe",
    "terminal.integrated.shellArgs.windows": [
        "--login"
    ],
    "terminal.integrated.env.windows": {
        "MSYSTEM": "MINGW64",
        "MSYS2_PATH_TYPE": "inherit",
        "CHERE_INVOKING": "enabled_from_arguments",
        "LANG": "zh_CN.UTF-8",
        "LC_ALL": "C"
    },
    "files.autoSave": "onFocusChange",
    "editor.minimap.enabled": false,
    "html.format.wrapLineLength": 0,
    "editor.insertSpaces": true,
    "editor.tabSize": 4,
    "editor.fontSize": 16,
    "terminal.integrated.fontSize": 16,
    "editor.detectIndentation": false,
    "workbench.iconTheme": "material-icon-theme",
    "git.confirmSync": false,
    "editor.dragAndDrop": false,
    "workbench.colorCustomizations": {
        "editorLineNumber.foreground": "#FFFF00",
        "editorCursor.foreground": "#00FFFF",
        "statusBar.background": "#BB0802",
        "tab.activeForeground": "#00FF00",
        "tab.inactiveForeground": "#969696"
    },
    "editor.quickSuggestions": {
        "comments": false, // <- no 24x7 IntelliSense in comments
        "strings": true, // but in strings and the other parts of source files
        "other": true
    },
    "workbench.editor.closeOnFileDelete": false,
    "window.zoomLevel": 0,
    "git.enableSmartCommit": true,
    "editor.fontFamily": "Consolas, 'Ubuntu Mono', Mocano, 'Courier New', monospace",
    "python.linting.enabled": false,
    "python.workspaceSymbols.tagFilePath": "",
    "python.terminal.activateEnvironment": false,
    "sync.autoDownload": true,
    "sync.autoUpload": false,
    "sync.forceDownload": false,
    "sync.quietSync": false,
    "sync.askGistName": false,
    "sync.removeExtensions": true,
    "sync.syncExtensions": true,
    "sync.gist": "7fd8e8640f97f3143d505341d0ca228e",
    "extensions.ignoreRecommendations": true,
    "C_Cpp.clang_format_fallbackStyle": "{BasedOnStyle: LLVM, IndentWidth: 4, AlwaysBreakTemplateDeclarations: true}",
    "C_Cpp.autoAddFileAssociations": false,
    "python.formatting.autopep8Args": [
        "--ignore",
        "E501"
    ],
    "extensions.showRecommendationsOnlyOnDemand": true,
    "workbench.settings.editor": "json",
    "todo-tree.defaultHighlight": {
        "icon": "check",
        "iconColour": "aqua",
        "foreground": "yellow",
        "type": "line"
    },
    "todo-tree.tags": [
        "LADYRICK"
    ],
    "todo-tree.customHighlight": {
        "LADYRICK": {}
    },
    "files.associations": {
        "*.cu": "cpp",
        "*.cl": "cpp"
    },
    "files.eol": "\n",
    "workbench.startupEditor": "welcomePage",
    "workbench.settings.useSplitJSON": true,
    "gitlens.codeLens.enabled": false,
    "gitlens.currentLine.enabled": false,
    "explorer.autoReveal": false,
    "latex-workshop.latex.tools": [
        {
            "name": "latexmk",
            "command": "latexmk",
            "args": [
                "-xelatex",
                "-interaction=nonstopmode",
                "-file-line-error",
                "-halt-on-error",
                "%DOC%"
            ],
            "env": {}
        }
    ],
    "latex-workshop.latex.recipes": [
        {
            "name": "latexmk 🔃",
            "tools": [
                "latexmk"
            ]
        }
    ],
    "latex-workshop.latex.autoClean.run": "onBuilt",
    "latex-workshop.latex.clean.fileTypes": [
        "*.aux",
        "*.bbl",
        "*.blg",
        "*.idx",
        "*.ind",
        "*.lof",
        "*.lot",
        "*.out",
        "*.toc",
        "*.acn",
        "*.acr",
        "*.alg",
        "*.glg",
        "*.glo",
        "*.gls",
        "*.ist",
        "*.fls",
        "*.log",
        "*.fdb_latexmk",
        "dtx-style.sty",
        "*.loe",
        "*.thm",
        "*.xdv"
    ],
    "latex-workshop.view.pdf.viewer": "tab",
    "editor.rulers": [80]
}
This is my .zshrc
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH

# Path to your oh-my-zsh installation.
export ZSH="/Users/ladyrickliu/.oh-my-zsh"

# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="robbyrussell"

# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )

# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"

# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"

# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"

# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13

# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"

# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"

# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"

# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"

# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"

# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"

# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder

# Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
  git
)

source $ZSH/oh-my-zsh.sh

# User configuration

# export MANPATH="/usr/local/man:$MANPATH"

# You may need to manually set your language environment
# export LANG=en_US.UTF-8

# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
#   export EDITOR='vim'
# else
#   export EDITOR='mvim'
# fi

# Compilation flags
# export ARCHFLAGS="-arch x86_64"

# ssh
# export SSH_KEY_PATH="~/.ssh/rsa_id"

# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"



#disable beep
setopt NO_BEEP
setopt NO_HIST_BEEP

export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles




# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/ladyrickliu/.miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/Users/ladyrickliu/.miniconda3/etc/profile.d/conda.sh" ]; then
        . "/Users/ladyrickliu/.miniconda3/etc/profile.d/conda.sh"
    else
        export PATH="/Users/ladyrickliu/.miniconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<
@vscodebot vscodebot bot added the new release label Apr 8, 2019
@DanTup
Copy link
Contributor

DanTup commented Apr 8, 2019

This looks a bit like the issue I raised at #46693 where the PATH entries come through in the wrong order. Never got to bottom of it 🤷‍♂️

@ladyrick
Copy link
Author

ladyrick commented Apr 8, 2019

This looks a bit like the issue I raised at #46693 where the PATH entries come through in the wrong order. Never got to bottom of it 🤷‍♂️

I didn't set "terminal.integrated.env.osx" in my settings.json.
I use conda. And conda would change the $PATH when zsh starts up.
I don't know whether conda and vscode is to blame.
However my terminal works well. So I think it is vscode.

@DanTup
Copy link
Contributor

DanTup commented Apr 8, 2019

I didn't set "terminal.integrated.env.osx" in my settings.json.

I wondered if maybe in my case that was just fluke, and it could occur other ways. However:

I use conda. And conda would change the $PATH when zsh starts up.

Now I'm not so sure. I wonder if it's just two instances of the same thing. I couldn't find any startup scripts of mine that were messing with PATH, however adding --noprofile --norc did fix it. I gave up what I was trying to do though, as I hit a dead end :(

@Tyriar
Copy link
Member

Tyriar commented Apr 12, 2019

I think this is related to your startup scripts running multiple times because the terminal inherits vscode's window environment.

/duplicate #70248

@Tyriar Tyriar closed this as completed Apr 12, 2019
@vscodebot vscodebot bot added the *duplicate Issue identified as a duplicate of another issue(s) label Apr 12, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Jun 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

3 participants