vscode: terminal.integrated.inheritEnv breaks integrated terminal

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 (0f3794b38477eea13fb47fbe15a42798e6129338, 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® Core™ 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%

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 32
  • Comments: 23 (3 by maintainers)

Most upvoted comments

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.

“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'

The reason Inherit Env isn’t enable by default is probably this: https://github.com/microsoft/vscode-python/issues/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.

Version: 1.41.1 Commit: 26076a4de974ead31f97692a0d32f90d735645c0 Date: 2019-12-18T15:04:31.999Z Electron: 6.1.5 Chrome: 76.0.3809.146 Node.js: 12.4.0 V8: 7.6.303.31-electron.0 OS: Linux x64 4.15.0-76-generic

I also run it from the terminal, usually doing a code . in a project directory.

It started happening to me today, I ticked this option and it started working image

Reproduced in Ubuntu 18.04, .deb Version: 1.9.1-1486597190

Workaround: remove "terminal.integrated.inheritEnv": false from options (but my use case does not require it)

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

Just a note: I think /proc/1/environ points to the environment of systemd or any init process, which is unlikely to be accessible by any user process without root privs.

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)

Same here with the latest 1.40.1 on amd64 Ubuntu 16.04.

I used ‘–user-data-dir’. Only adding ‘–verbose’ make the integrated terminal work.

“terminal.integrated.inheritEnv”: false

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

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.

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

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

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

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 (0f3794b38477eea13fb47fbe15a42798e6129338, 2019-07-03T13:20:56.241Z) OS version: Linux x64 5.1.8-1-MANJARO

System Info
Item Value
CPUs Intel® Core™ 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