Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
1e3cc1a3
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,发现更多精彩内容 >>
提交
1e3cc1a3
编写于
8月 01, 2019
作者:
D
Daniel Imms
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Don't fail hard when shell/shellArgs vars aren't resolved
Fixes #78307
上级
23875a28
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
30 addition
and
9 deletion
+30
-9
src/vs/workbench/api/node/extHostTerminalService.ts
src/vs/workbench/api/node/extHostTerminalService.ts
+3
-2
src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts
.../workbench/contrib/terminal/common/terminalEnvironment.ts
+21
-5
src/vs/workbench/contrib/terminal/electron-browser/terminalInstanceService.ts
...trib/terminal/electron-browser/terminalInstanceService.ts
+6
-2
未找到文件。
src/vs/workbench/api/node/extHostTerminalService.ts
浏览文件 @
1e3cc1a3
...
...
@@ -371,7 +371,8 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape {
process
.
env
.
hasOwnProperty
(
'
PROCESSOR_ARCHITEW6432
'
),
process
.
env
.
windir
,
this
.
_lastActiveWorkspace
,
this
.
_variableResolver
this
.
_variableResolver
,
this
.
_logService
);
}
...
...
@@ -383,7 +384,7 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape {
return
this
.
_apiInspectConfigToPlain
<
string
|
string
[]
>
(
setting
);
};
return
terminalEnvironment
.
getDefaultShellArgs
(
fetchSetting
,
this
.
_isWorkspaceShellAllowed
,
this
.
_lastActiveWorkspace
,
this
.
_variableResolver
);
return
terminalEnvironment
.
getDefaultShellArgs
(
fetchSetting
,
this
.
_isWorkspaceShellAllowed
,
this
.
_lastActiveWorkspace
,
this
.
_variableResolver
,
this
.
_logService
);
}
public
async
resolveTerminalRenderer
(
id
:
number
):
Promise
<
vscode
.
TerminalRenderer
>
{
...
...
src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts
浏览文件 @
1e3cc1a3
...
...
@@ -78,7 +78,11 @@ function resolveConfigurationVariables(configurationResolverService: IConfigurat
Object
.
keys
(
env
).
forEach
((
key
)
=>
{
const
value
=
env
[
key
];
if
(
typeof
value
===
'
string
'
&&
lastActiveWorkspaceRoot
!==
null
)
{
env
[
key
]
=
configurationResolverService
.
resolve
(
lastActiveWorkspaceRoot
,
value
);
try
{
env
[
key
]
=
configurationResolverService
.
resolve
(
lastActiveWorkspaceRoot
,
value
);
}
catch
(
e
)
{
env
[
key
]
=
value
;
}
}
});
return
env
;
...
...
@@ -143,7 +147,7 @@ export function getCwd(
// There was an issue resolving a variable, just use the unresolved customCwd which
// which will fail, and log the error in the console.
if
(
logService
)
{
logService
.
error
(
'
Resolving
terminal.integrated.cwd
'
,
e
);
logService
.
error
(
'
Could not resolve
terminal.integrated.cwd
'
,
e
);
}
return
customCwd
;
}
...
...
@@ -192,7 +196,8 @@ export function getDefaultShell(
windir
:
string
|
undefined
,
lastActiveWorkspace
:
IWorkspaceFolder
|
undefined
,
configurationResolverService
:
IConfigurationResolverService
|
undefined
,
platformOverride
:
platform
.
Platform
=
platform
.
platform
,
logService
:
ILogService
,
platformOverride
:
platform
.
Platform
=
platform
.
platform
):
string
{
const
platformKey
=
platformOverride
===
platform
.
Platform
.
Windows
?
'
windows
'
:
platformOverride
===
platform
.
Platform
.
Mac
?
'
osx
'
:
'
linux
'
;
const
shellConfigValue
=
fetchSetting
(
`terminal.integrated.shell.
${
platformKey
}
`
);
...
...
@@ -214,7 +219,12 @@ export function getDefaultShell(
}
if
(
configurationResolverService
)
{
executable
=
configurationResolverService
.
resolve
(
lastActiveWorkspace
,
executable
);
try
{
executable
=
configurationResolverService
.
resolve
(
lastActiveWorkspace
,
executable
);
}
catch
(
e
)
{
logService
.
error
(
`Could not resolve terminal.integrated.shell.
${
platformKey
}
`
,
e
);
executable
=
executable
;
}
}
return
executable
;
...
...
@@ -225,6 +235,7 @@ export function getDefaultShellArgs(
isWorkspaceShellAllowed
:
boolean
,
lastActiveWorkspace
:
IWorkspaceFolder
|
undefined
,
configurationResolverService
:
IConfigurationResolverService
|
undefined
,
logService
:
ILogService
,
platformOverride
:
platform
.
Platform
=
platform
.
platform
,
):
string
|
string
[]
{
const
platformKey
=
platformOverride
===
platform
.
Platform
.
Windows
?
'
windows
'
:
platformOverride
===
platform
.
Platform
.
Mac
?
'
osx
'
:
'
linux
'
;
...
...
@@ -236,7 +247,12 @@ export function getDefaultShellArgs(
if
(
configurationResolverService
)
{
const
resolvedArgs
:
string
[]
=
[];
for
(
const
arg
of
args
)
{
resolvedArgs
.
push
(
configurationResolverService
.
resolve
(
lastActiveWorkspace
,
arg
));
try
{
resolvedArgs
.
push
(
configurationResolverService
.
resolve
(
lastActiveWorkspace
,
arg
));
}
catch
(
e
)
{
logService
.
error
(
`Could not resolve terminal.integrated.shellArgs.
${
platformKey
}
`
,
e
);
resolvedArgs
.
push
(
arg
);
}
}
args
=
resolvedArgs
;
}
...
...
src/vs/workbench/contrib/terminal/electron-browser/terminalInstanceService.ts
浏览文件 @
1e3cc1a3
...
...
@@ -20,6 +20,7 @@ import { getMainProcessParentEnv } from 'vs/workbench/contrib/terminal/node/term
import
{
IConfigurationResolverService
}
from
'
vs/workbench/services/configurationResolver/common/configurationResolver
'
;
import
{
IHistoryService
}
from
'
vs/workbench/services/history/common/history
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
let
Terminal
:
typeof
XTermTerminal
;
let
WebLinksAddon
:
typeof
XTermWebLinksAddon
;
...
...
@@ -34,7 +35,8 @@ export class TerminalInstanceService implements ITerminalInstanceService {
@
IStorageService
private
readonly
_storageService
:
IStorageService
,
@
IConfigurationResolverService
private
readonly
_configurationResolverService
:
IConfigurationResolverService
,
@
IWorkspaceContextService
private
readonly
_workspaceContextService
:
IWorkspaceContextService
,
@
IHistoryService
private
readonly
_historyService
:
IHistoryService
@
IHistoryService
private
readonly
_historyService
:
IHistoryService
,
@
ILogService
private
readonly
_logService
:
ILogService
)
{
}
...
...
@@ -84,6 +86,7 @@ export class TerminalInstanceService implements ITerminalInstanceService {
process
.
env
.
windir
,
lastActiveWorkspace
,
this
.
_configurationResolverService
,
this
.
_logService
,
platformOverride
);
const
args
=
getDefaultShellArgs
(
...
...
@@ -91,6 +94,7 @@ export class TerminalInstanceService implements ITerminalInstanceService {
isWorkspaceShellAllowed
,
lastActiveWorkspace
,
this
.
_configurationResolverService
,
this
.
_logService
,
platformOverride
);
return
Promise
.
resolve
({
shell
,
args
});
...
...
@@ -99,4 +103,4 @@ export class TerminalInstanceService implements ITerminalInstanceService {
public
getMainProcessParentEnv
():
Promise
<
IProcessEnvironment
>
{
return
getMainProcessParentEnv
();
}
}
\ No newline at end of file
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录