Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
c43b97e6
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c43b97e6
编写于
6月 14, 2019
作者:
A
Alex Ross
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove terminal task dependency on getDefaultShell
Part of #69113
上级
03394ab5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
26 addition
and
4 deletion
+26
-4
src/vs/workbench/contrib/tasks/electron-browser/task.contribution.ts
...bench/contrib/tasks/electron-browser/task.contribution.ts
+4
-2
src/vs/workbench/contrib/tasks/electron-browser/terminalTaskSystem.ts
...ench/contrib/tasks/electron-browser/terminalTaskSystem.ts
+22
-2
未找到文件。
src/vs/workbench/contrib/tasks/electron-browser/task.contribution.ts
浏览文件 @
c43b97e6
...
...
@@ -91,6 +91,7 @@ import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/wor
import
{
RunAutomaticTasks
,
AllowAutomaticTaskRunning
,
DisallowAutomaticTaskRunning
}
from
'
vs/workbench/contrib/tasks/electron-browser/runAutomaticTasks
'
;
import
{
IWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
{
ITerminalInstanceService
}
from
'
vs/workbench/contrib/terminal/browser/terminal
'
;
let
tasksCategory
=
nls
.
localize
(
'
tasksCategory
'
,
"
Tasks
"
);
...
...
@@ -355,7 +356,8 @@ class TaskService extends Disposable implements ITaskService {
@
INotificationService
private
readonly
notificationService
:
INotificationService
,
@
IContextKeyService
contextKeyService
:
IContextKeyService
,
@
IWorkbenchEnvironmentService
private
readonly
environmentService
:
IWorkbenchEnvironmentService
,
@
IWorkbenchLayoutService
private
readonly
layoutService
:
IWorkbenchLayoutService
@
IWorkbenchLayoutService
private
readonly
layoutService
:
IWorkbenchLayoutService
,
@
ITerminalInstanceService
private
readonly
terminalInstanceService
:
ITerminalInstanceService
,
)
{
super
();
...
...
@@ -1235,7 +1237,7 @@ class TaskService extends Disposable implements ITaskService {
this
.
terminalService
,
this
.
outputService
,
this
.
panelService
,
this
.
markerService
,
this
.
modelService
,
this
.
configurationResolverService
,
this
.
telemetryService
,
this
.
contextService
,
this
.
environmentService
,
TaskService
.
OutputChannelId
,
this
.
fileService
,
TaskService
.
OutputChannelId
,
this
.
fileService
,
this
.
terminalInstanceService
,
(
workspaceFolder
:
IWorkspaceFolder
)
=>
{
if
(
!
workspaceFolder
)
{
return
undefined
;
...
...
src/vs/workbench/contrib/tasks/electron-browser/terminalTaskSystem.ts
浏览文件 @
c43b97e6
...
...
@@ -42,8 +42,8 @@ import { REMOTE_HOST_SCHEME } from 'vs/platform/remote/common/remoteHosts';
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
IWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
getDefaultShell
}
from
'
vs/workbench/contrib/terminal/node/terminal
'
;
import
{
IPanelService
}
from
'
vs/workbench/services/panel/common/panelService
'
;
import
{
ITerminalInstanceService
}
from
'
vs/workbench/contrib/terminal/browser/terminal
'
;
interface
TerminalData
{
terminal
:
ITerminalInstance
;
...
...
@@ -172,6 +172,7 @@ export class TerminalTaskSystem implements ITaskSystem {
private
environmentService
:
IWorkbenchEnvironmentService
,
private
outputChannelId
:
string
,
private
fileService
:
IFileService
,
private
terminalInstanceService
:
ITerminalInstanceService
,
taskSystemInfoResolver
:
TaskSystemInfoResolver
,
)
{
...
...
@@ -751,6 +752,25 @@ export class TerminalTaskSystem implements ITaskSystem {
return
nls
.
localize
(
'
TerminalTaskSystem.terminalName
'
,
'
Task - {0}
'
,
needsFolderQualification
?
task
.
getQualifiedLabel
()
:
task
.
configurationProperties
.
name
);
}
private
getDefaultShell
(
platform
:
Platform
.
Platform
):
string
{
let
defaultShell
:
string
|
undefined
=
undefined
;
try
{
defaultShell
=
this
.
terminalInstanceService
.
getDefaultShell
(
platform
);
}
catch
{
// Do nothing
}
if
(
!
defaultShell
)
{
// Make up a guess for the default shell.
if
(
platform
===
Platform
.
Platform
.
Windows
)
{
defaultShell
=
'
cmd.exe
'
;
}
else
{
defaultShell
=
'
bash.exe
'
;
}
console
.
warn
(
'
Cannot get the default shell.
'
);
}
return
defaultShell
;
}
private
createShellLaunchConfig
(
task
:
CustomTask
|
ContributedTask
,
variableResolver
:
VariableResolver
,
platform
:
Platform
.
Platform
,
options
:
CommandOptions
,
command
:
CommandString
,
args
:
CommandString
[],
waitOnExit
:
boolean
|
string
):
IShellLaunchConfig
|
undefined
{
let
shellLaunchConfig
:
IShellLaunchConfig
;
let
isShellCommand
=
task
.
command
.
runtime
===
RuntimeType
.
Shell
;
...
...
@@ -759,7 +779,7 @@ export class TerminalTaskSystem implements ITaskSystem {
let
originalCommand
=
task
.
command
.
name
;
if
(
isShellCommand
)
{
shellLaunchConfig
=
{
name
:
terminalName
,
executable
:
undefined
,
args
:
undefined
,
waitOnExit
};
this
.
terminalService
.
configHelper
.
mergeDefaultShellPathAndArgs
(
shellLaunchConfig
,
getDefaultShell
(
platform
),
platform
);
this
.
terminalService
.
configHelper
.
mergeDefaultShellPathAndArgs
(
shellLaunchConfig
,
this
.
getDefaultShell
(
platform
),
platform
);
let
shellSpecified
:
boolean
=
false
;
let
shellOptions
:
ShellConfiguration
|
undefined
=
task
.
command
.
options
&&
task
.
command
.
options
.
shell
;
if
(
shellOptions
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录