Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
f0bd7eee
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f0bd7eee
编写于
1月 22, 2021
作者:
M
Megan Rogge
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
only create processEnvironment once, now tests pass
Co-authored by: Daniel Imms <daimms@microsoft.com>
上级
4300e6c7
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
4 addition
and
24 deletion
+4
-24
src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts
...kbench/contrib/terminal/browser/terminalProcessManager.ts
+4
-24
未找到文件。
src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts
浏览文件 @
f0bd7eee
...
...
@@ -24,7 +24,7 @@ import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteA
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
withNullAsUndefined
}
from
'
vs/base/common/types
'
;
import
{
IEnvironmentVariableService
,
IMergedEnvironmentVariableCollection
,
IEnvironmentVariableInfo
}
from
'
vs/workbench/contrib/terminal/common/environmentVariable
'
;
import
{
EnvironmentVariableInfo
Stale
,
EnvironmentVariableInfoChangesActiv
e
}
from
'
vs/workbench/contrib/terminal/browser/environmentVariableInfo
'
;
import
{
EnvironmentVariableInfo
ChangesActive
,
EnvironmentVariableInfoStal
e
}
from
'
vs/workbench/contrib/terminal/browser/environmentVariableInfo
'
;
import
{
IPathService
}
from
'
vs/workbench/services/path/common/pathService
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
...
...
@@ -168,12 +168,8 @@ export class TerminalProcessManager extends Disposable implements ITerminalProce
const
activeWorkspaceRootUri
=
this
.
_historyService
.
getLastActiveWorkspaceRoot
();
<<<<<<<
HEAD
// this is a copy of what the merged environment collection is on the remote side
await
this
.
_setupEnvVariableInfo
(
activeWorkspaceRootUri
,
shellLaunchConfig
);
=======
await
this
.
_refreshEnvironmentVariables
(
activeWorkspaceRootUri
,
shellLaunchConfig
);
>>>>>>>
60
f1eac940
(
Fix
#
105177
get
terminal
environment
variable
to
show
up
in
remote
container
)
const
enableRemoteAgentTerminals
=
this
.
_configHelper
.
config
.
serverSpawn
;
if
(
enableRemoteAgentTerminals
)
{
...
...
@@ -240,11 +236,7 @@ export class TerminalProcessManager extends Disposable implements ITerminalProce
}
// Fetch any extension environment additions and apply them
<<<<<<<
HEAD
private
async
_setupEnvVariableInfo
(
activeWorkspaceRootUri
:
URI
|
undefined
,
shellLaunchConfig
:
IShellLaunchConfig
):
Promise
<
void
>
{
=======
private
async
_refreshEnvironmentVariables
(
activeWorkspaceRootUri
:
URI
|
undefined
,
shellLaunchConfig
:
IShellLaunchConfig
):
Promise
<
void
>
{
>>>>>>>
60
f1eac940
(
Fix
#
105177
get
terminal
environment
variable
to
show
up
in
remote
container
)
private
async
_setupEnvVariableInfo
(
activeWorkspaceRootUri
:
URI
|
undefined
,
shellLaunchConfig
:
IShellLaunchConfig
):
Promise
<
platform
.
IProcessEnvironment
>
{
const
platformKey
=
platform
.
isWindows
?
'
windows
'
:
(
platform
.
isMacintosh
?
'
osx
'
:
'
linux
'
);
const
lastActiveWorkspace
=
activeWorkspaceRootUri
?
withNullAsUndefined
(
this
.
_workspaceContextService
.
getWorkspaceFolder
(
activeWorkspaceRootUri
))
:
undefined
;
const
envFromConfigValue
=
this
.
_workspaceConfigurationService
.
inspect
<
ITerminalEnvironment
|
undefined
>
(
`terminal.integrated.env.
${
platformKey
}
`
);
...
...
@@ -256,21 +248,19 @@ export class TerminalProcessManager extends Disposable implements ITerminalProce
if
(
!
shellLaunchConfig
.
strictEnv
)
{
this
.
_extEnvironmentVariableCollection
=
this
.
_environmentVariableService
.
mergedCollection
;
this
.
_register
(
this
.
_environmentVariableService
.
onDidChangeCollections
(
newCollection
=>
this
.
_onEnvironmentVariableCollectionChange
(
newCollection
)));
<<<<<<<
HEAD
// For remote terminals, this is a copy of the mergedEnvironmentCollection created on
// the remote side. Since the environment collection is synced between the remote and
// local sides immediately this is a fairly safe way of enabling the env var diffing and
// info widget. While technically these could differ due to the slight change of a race
// condition, the chance is minimal plus the impact on the user is also not that great
// if it happens - it's not worth adding plumbing to sync back the resolved collection.
=======
>>>>>>>
60
f1eac940
(
Fix
#
105177
get
terminal
environment
variable
to
show
up
in
remote
container
)
this
.
_extEnvironmentVariableCollection
.
applyToProcessEnvironment
(
env
);
if
(
this
.
_extEnvironmentVariableCollection
.
map
.
size
>
0
)
{
this
.
_environmentVariableInfo
=
new
EnvironmentVariableInfoChangesActive
(
this
.
_extEnvironmentVariableCollection
);
this
.
_onEnvironmentVariableInfoChange
.
fire
(
this
.
_environmentVariableInfo
);
}
}
return
env
;
}
private
async
_launchLocalProcess
(
...
...
@@ -310,17 +300,7 @@ export class TerminalProcessManager extends Disposable implements ITerminalProce
this
.
_logService
);
const
platformKey
=
platform
.
isWindows
?
'
windows
'
:
(
platform
.
isMacintosh
?
'
osx
'
:
'
linux
'
);
const
envFromConfigValue
=
this
.
_workspaceConfigurationService
.
inspect
<
ITerminalEnvironment
|
undefined
>
(
`terminal.integrated.env.
${
platformKey
}
`
);
const
isWorkspaceShellAllowed
=
this
.
_configHelper
.
checkWorkspaceShellPermissions
();
const
baseEnv
=
this
.
_configHelper
.
config
.
inheritEnv
?
processEnv
:
await
this
.
_terminalInstanceService
.
getMainProcessParentEnv
();
const
env
=
terminalEnvironment
.
createTerminalEnvironment
(
shellLaunchConfig
,
envFromConfigValue
,
terminalEnvironment
.
createVariableResolver
(
lastActiveWorkspace
,
this
.
_configurationResolverService
),
isWorkspaceShellAllowed
,
this
.
_productService
.
version
,
this
.
_configHelper
.
config
.
detectLocale
,
baseEnv
);
<<<<<<<
HEAD
await
this
.
_setupEnvVariableInfo
(
activeWorkspaceRootUri
,
shellLaunchConfig
);
=======
await
this
.
_refreshEnvironmentVariables
(
activeWorkspaceRootUri
,
shellLaunchConfig
);
>>>>>>>
60
f1eac940
(
Fix
#
105177
get
terminal
environment
variable
to
show
up
in
remote
container
)
const
env
=
await
this
.
_setupEnvVariableInfo
(
activeWorkspaceRootUri
,
shellLaunchConfig
);
const
useConpty
=
this
.
_configHelper
.
config
.
windowsEnableConpty
&&
!
isScreenReaderModeEnabled
;
return
this
.
_terminalInstanceService
.
createTerminalProcess
(
shellLaunchConfig
,
initialCwd
,
cols
,
rows
,
env
,
useConpty
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录