You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Fedora installations with some packages installed, e.g. environment-modules-3.2.10-16.fc22.x86_64 , scl-utils-2.0.1-3.fc22.x86_64, shell functions are exported in the environment:
$ printenv
…
BASH_FUNC_module()=() { eval `/usr/bin/modulecmd bash $*`
}
BASH_FUNC_scl()=() { local CMD=$1;
if [ "$CMD" = "load" -o "$CMD" = "unload" ]; then
eval "module $@";
else
/usr/bin/scl "$@";
fi
}
It seems something in VS Code is misparsing or corrupting these variable definitions, because various shell commands (e.g. a build task) then output things like
/bin/sh: module: line 1: syntax error: unexpected end of file
/bin/sh: error importing function definition for `BASH_FUNC_module'
/bin/sh: scl: line 1: syntax error: unexpected end of file
/bin/sh: error importing function definition for `BASH_FUNC_scl'
before or after their real output. This obviously confuses problem matchers, showOutput and the like.
been using a fedora kde plasma 5.6 and doesn't have this issue but I had to use PR #3495 to specify konsole as KDE doesn't support the gnome-terminal or x-terminal-emulator out of the box
changed the title [-]Error importing function definition for `BASH_FUNC_*'[/-][+]Error importing function definition for `BASH_FUNC_*' (VSCode corrupts multi-line environment variables)[/+]on Mar 24, 2016
Activity
Add Visual Studio Code tasks.json
Tyriar commentedon Mar 22, 2016
I've seen this in the output and when playing with getting Open in Terminal working for Fedora in #4478
Tyriar commentedon Mar 23, 2016
Error seems related to the shellshock bug, probably not that though since upgrading to the latest bash didn't change it (bash-4.3.42-3)
Tyriar commentedon Mar 24, 2016
Kind of seems like a Fedora issue, it's just strange that it only seems to happen when gnome-terminal is launched through Node.
pflannery commentedon Mar 24, 2016
been using a fedora kde plasma 5.6 and doesn't have this issue but I had to use PR #3495 to specify
konsoleas KDE doesn't support thegnome-terminalorx-terminal-emulatorout of the boxTyriar commentedon Mar 24, 2016
Running
gnome-terminalthrough gnome-terminal launches a clean terminal:It seems to be fine running through regular node too:
Tyriar commentedon Mar 24, 2016
Peter Flannery (@pflannery) do you have the offending lines show up after running
env?Tyriar commentedon Mar 24, 2016
The env variables are added by the environment-modules package which can be removed using:
Not sure what it does or if it's important yet though.
pflannery commentedon Mar 24, 2016
Daniel Imms (@Tyriar) no it's clean on fedora kde plasma like you last screenshot
Tyriar commentedon Mar 24, 2016
Peter Flannery (@pflannery) I mean run something like this and see if there's output:
env | grep BASH_FUNC_11 remaining items
mtrmac commentedon Mar 24, 2016
Browsing the source without having any idea how it is organized, https://github.com/Microsoft/vscode/blob/master/src/vs/base/node/env.ts looks really suspicious (run
$SHELL -ilc env, split output by lines).Tyriar commentedon Mar 24, 2016
I think I've found the underlying issue. I reproduced this on Ubuntu:
process.envin dev tools:TEST_ENV_VAR="multi-line"Tyriar commentedon Mar 24, 2016
Miloslav Trmač (@mtrmac) that looks like it's it! I was suspecting somewhere
envwas being split by\n.Tyriar commentedon Mar 24, 2016
Got a fix working on Ubuntu & Fedora! Thanks Miloslav Trmač (@mtrmac) Peter Flannery (@pflannery) for the help 🎆
[-]Error importing function definition for `BASH_FUNC_*'[/-][+]Error importing function definition for `BASH_FUNC_*' (VSCode corrupts multi-line environment variables)[/+]Reland: Support multi-line environment variables
[-]Error importing function definition for `BASH_FUNC_*' (VSCode corrupts multi-line environment variables)[/-][+]VSCode corrupts multi-line environment variables[/+]Fixes #3928
Fixes #3928 (#180404)