Closed b0wter closed 6 years ago
It looks like https://github.com/dotnet/corefx/issues/26966 has issues with certain terminals, let's track it there until that discussion is resolved.
Is there a way to specify a terminal as an argument to vscode when launching? Without wanting to set TERM in something like ~/.bashrc, as a workaround I've changed the default shell here.
@jogleasonjr you can set the shell and its arguments using terminal.integrated.<os>.shell
and terminal.integrated.<os>.shellArgs
. Changing $TERM
could break stuff, there is no nicer way to do that AFAIK (I don't think the .env
setting will allow that to be set).
@Tyriar yes I wouldn't want to change $TERM
for anything non-experimental. It seems to me that the integrated terminal's configuration does not affect the one that invokes dotnet build
from tasks.json
.
For example setting an alternative shell using terminal.integrated.linux.shell
(or just typing TERM=something_else
in the integrated terminal on vscode launch) will fix the build errors in the terminal but not in a debug task.
Launching and attaching still work thankfully, so it seems to me that the best workaround for the moment is to comment out preLaunchTask
in 'launch.json` and just build outside of the editor like the good 'ol days.
I think tasks take control of the shell as otherwise tasks.json would not be portable (eg. things that run in WSL don't run in cmd)
One way I found to do that in tasks.json is by setting the environment variable in the command
property before the usual dotnet build
:
"tasks": [
{
"label": "build",
"command": "dotnet build",
"linux": {
"command": "env TERM=rxvt-unicode-256color dotnet build"
},
...
}
]
Setting TERM in tasks.linux.options.env: { }
didn't seem to take affect, nor did the user setting terminal.integrated.env.linux: { }
.
So the above workaround, as ill-advised as it may be in many cases, seems to work for now until this update propagates its way to vscode and the arch repos. It will allow for one click (or F5 key) build/debugging.
Steps to Reproduce:
=> Build will crash immediately with the following exception:
This might be related with https://github.com/dotnet/corefx/issues/26966
However, using the dotnet command in a regular terminal causes no problems at all (which is what the original reporter stated (running dotnet restore crashes in the terminal).
Does this issue occur when all extensions are disabled?: N/A
Cannot run this without the c#/dotnet core extensions.