Skip to content

terminal.integrated.inheritEnv breaks integrated terminal #76542

Closed

Description

@GammaGames

Issue Type: Bug

  1. Add "terminal.integrated.inheritEnv": false to settings.json
  2. Try to open terminal
  3. Terminal blinks and can't do anything

Screen record from 2019-07-03 14 44 16

VS Code version: Code 1.36.0 (0f3794b, 2019-07-03T13:20:56.241Z)
OS version: elementary OS 5.0 Juno (Ubuntu 18.04.2 LTS), Linux x64 4.15.0-54-generic

System Info
Item Value
CPUs Intel(R) Core(TM) i7-7560U CPU @ 2.40GHz (4 x 3454)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: disabled_software
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: unavailable_off
viz_display_compositor: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) 2, 2, 2
Memory (System) 15.28GB (4.55GB free)
Process Argv --unity-launch
Screen Reader no
VM 0%

Activity

  1. teohhanhui commented on Jul 4, 2019

    @teohhanhui

    Same problem. I see this in output of Log (Window):

    [2019-07-04 18:06:11.943] [renderer1] [error] A system error occurred (EACCES: permission denied, open '/proc/2194/environ'): Error: EACCES: permission denied, open '/proc/2194/environ'

    $ ls -la /proc/2194/environ
    -r-------- 1 root root 0 Jul  4 17:44 /proc/2194/environ
    $ ps -p 2194 -o comm=
    gnome-shell
    

    VS Code version: Code 1.36.0 (0f3794b, 2019-07-03T13:20:56.241Z)
    OS version: Linux x64 5.1.8-1-MANJARO

    System Info
    Item Value
    CPUs Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz (8 x 2992)
    GPU Status 2d_canvas: enabled
    flash_3d: enabled
    flash_stage3d: enabled
    flash_stage3d_baseline: enabled
    gpu_compositing: enabled
    multiple_raster_threads: enabled_on
    native_gpu_memory_buffers: disabled_software
    oop_rasterization: disabled_off
    protected_video_decode: unavailable_off
    rasterization: disabled_software
    skia_deferred_display_list: disabled_off
    skia_renderer: disabled_off
    surface_synchronization: enabled_on
    video_decode: unavailable_off
    viz_display_compositor: disabled_off
    webgl: enabled
    webgl2: enabled
    Load (avg) 1, 1, 1
    Memory (System) 15.45GB (0.97GB free)
    Process Argv
    Screen Reader no
    VM 0%
    Extensions (24)
    Extension Author (truncated) Version
    latte Kas 0.1.1
    vscode-paste-and-indent Rub 0.0.8
    cucumberautocomplete ale 2.14.0
    xml Dot 2.5.0
    EditorConfig Edi 0.13.0
    vsc-material-theme Equ 29.2.0
    vsc-material-theme-icons equ 1.0.6
    varnish-vcl flo 0.1.3
    vscode-pull-request-github Git 0.8.0
    vscode-peacock joh 2.4.0
    chat kar 0.15.5
    restructuredtext lex 110.0.0
    dotenv mik 1.0.1
    vscode-docker ms- 0.6.4
    python ms- 2019.6.22090
    cpptools ms- 0.24.0
    vsliveshare ms- 1.0.488
    vsliveshare-audio ms- 0.1.56
    vsliveshare-pack ms- 0.3.2
    vscode-yaml red 0.4.1
    vscode-qt-for-python sea 0.3.0
    gitconfig sid 2.0.0
    shellcheck tim 0.6.0
    twig wha 1.0.2
  2. teohhanhui commented on Jul 4, 2019

    @teohhanhui
  3. added
    bug
    terminal
    linux
    on Oct 10, 2019
  4. gandroz commented on Oct 10, 2019

    @gandroz

    On Ubuntu 18.04, I installed VSCode with snap. When I launch VSC inside a terminal with
    > /snap/bin/code
    I am able to work in the VSC terminal whatever the terminal.integrated.inheritEnv settings, but when I launch it with the .desktop link, if the settings is at false I got the issue of a blank terminal.

  5. teohhanhui commented on Oct 11, 2019

    @teohhanhui

    For whatever reason, I'm no longer able to reproduce this bug.

    "terminal.integrated.inheritEnv": false seems to work perfectly for me now.

    EDIT: Probably related to https://gitlab.gnome.org/World/ShellExtensions/desktop-icons/issues/155

  6. gandroz commented on Oct 11, 2019

    @gandroz

    For whatever reason, I'm no longer able to reproduce this bug.

    "terminal.integrated.inheritEnv": false seems to work perfectly for me now.

    not for me (even with the 1.39.1 version)

  7. GammaGames commented on Oct 11, 2019

    @GammaGames
    Author

    I also still get the issue, though I'm using the deb

  8. astrowonk commented on Oct 11, 2019

    @astrowonk

    "terminal.integrated.inheritEnv": false

    produced the blank terminal window that the above mention for me on RHEL, VS Code 1.39.1. Log Window shows the same error as mentioned earlier:

    A system error occurred (EACCES: permission denied, open '/proc/1/environ'): Error: EACCES: permission denied, open '/proc/1/environ'

  9. added this to the Backlog milestone on Oct 26, 2019
  10. onpix commented on Nov 6, 2019

    @onpix

    I got this problem after once running sudo code --user-data-dir
    and after that I always get this bug when I launch vscode in without sudo

  11. 6 remaining items

  12. cyogian commented on Feb 21, 2020

    @cyogian

    A system error occurred (EACCES: permission denied, open '/proc/1598/environ'): Error: EACCES: permission denied, open '/proc/1598/environ'

    In fedora:

    1. Just go to settings > user
    2. Search terminal.integrated.inheritEnv
    3. Check it to enable it.

    For some reason it is not enabled by default and that is preventing the Terminal from running.

  13. vhquang commented on Apr 27, 2020

    @vhquang

    The reason Inherit Env isn't enable by default is probably this:
    microsoft/vscode-python#7607
    (ie: to make it more compatible with conda)
    I can confirm it happens for version 1.44.2, with both gnome-shortcut and terminal. Temporary fix for me is enable it, since my particular project does not care about it. But that is just a workaround.

  14. rickstaa commented on Sep 29, 2020

    @rickstaa

    I also experience this issue when my settings.json contains the terminal.integrated.inheritEnv: False flag. Like Martin Brook (@martinlbrook) mentioned this only happens if you use the desktop shortcut or as others mentioned you set it to "terminal.integrated.inheritEnv": true.

  15. danchaseCTS commented on Oct 23, 2020

    @danchaseCTS

    For Windows, I tried to use this answer, as I had environment variables not being included, and that question was closed as a dup to this one. So I went to the setting in vscode, and it says "Terminal>Integrated:Inherit Env" is checked, but it says "This is not supported on Windows".

    So which is it? I know the variable list looks completely different than if I just launched CMD and typed "set".

    My use case is: "set NODE_OPTIONS=--max_old_space_size=8192" because in Angular I get an out-of-memory error when trying to build prod, and setting an environment variable tells Node to use a larger VM. This is supposed to be better in my situation than other proposed solutions, but I think I've fallen down a rabbit hole!

    For reference the fix I needed best fits on #94697 but it sent me here - any help would be appreciated.

    Edit: I fixed my issue using a different method:
    "terminal.integrated.env.windows": {
    "NODE_OPTIONS": "--max_old_space_size=8192"
    }

    However I do wish I could have just had the variables in the terminal from the system.

    Edit: Interesting, when I went into the settings.json file, even though the settings shows inherit to be true (and says not supported in Windows), I see the line: "terminal.integrated.inheritEnv": false... Curious

  16. Tyriar commented on Oct 30, 2020

    @Tyriar
    Contributor

    Chase Technology Solutions (@danchaseCTS) the setting is not supported on Windows, the environment will be different though because it's essentially set to true always there since that's the default. Some extensions like Python may set inheritEnv to false which could explain why it was there.

  17. jmp75 commented on Nov 23, 2020

    @jmp75

    This issue (re)-appeared after an upgrade on a Debian Testing of VSCode to Version: 1.52.0-insider

    Commit: caf01ba
    Date: 2020-11-20T07:26:12.345Z
    Electron: 9.3.3
    Chrome: 83.0.4103.122
    Node.js: 12.14.1
    V8: 8.3.110.13-electron.0
    OS: Linux x64 5.9.0-2-amd64

    Setting to 'true' appears to resolve it.

    "terminal.integrated.inheritEnv": true
  18. DanRunfola commented on Dec 1, 2020

    @DanRunfola

    Confirming this issue is still live on Ubuntu 18.04.

    Version: 1.51.1
    Commit: e5a624b
    Date: 2020-11-10T23:31:29.624Z
    Electron: 9.3.3
    Chrome: 83.0.4103.122
    Node.js: 12.14.1
    V8: 8.3.110.13-electron.0
    OS: Linux x64 5.4.0-53-generic snap

  19. Tyriar commented on May 4, 2021

    @Tyriar
    Contributor

    We are removing inheritEnv in v1.57 as we will behave like regular terminals now wrt the base environment

  20. Tyriar commented on May 14, 2021

    @Tyriar
    Contributor

    It's actually coming back, but it's using a new way of getting the environment that should not have this issue.

  21. added
    on-release-notes
    on Jun 3, 2021
  22. locked and limited conversation to collaborators on Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

buglinuxon-release-notesterminalverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions