Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gzupanda
code-server
提交
7e326182
C
code-server
项目概览
gzupanda
/
code-server
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
code-server
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
7e326182
编写于
5月 01, 2021
作者:
A
Akash Satheesan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(lib/vscode): fix terminal channel
上级
9665127d
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
13 addition
and
15 deletion
+13
-15
lib/vscode/src/vs/server/node/channel.ts
lib/vscode/src/vs/server/node/channel.ts
+13
-15
未找到文件。
lib/vscode/src/vs/server/node/channel.ts
浏览文件 @
7e326182
...
@@ -43,7 +43,7 @@ import { ExtensionScanner, ExtensionScannerInput } from 'vs/workbench/services/e
...
@@ -43,7 +43,7 @@ import { ExtensionScanner, ExtensionScannerInput } from 'vs/workbench/services/e
class
Watcher
extends
DiskFileSystemProvider
{
class
Watcher
extends
DiskFileSystemProvider
{
public
readonly
watches
=
new
Map
<
number
,
IDisposable
>
();
public
readonly
watches
=
new
Map
<
number
,
IDisposable
>
();
public
dispose
():
void
{
public
override
dispose
():
void
{
this
.
watches
.
forEach
((
w
)
=>
w
.
dispose
());
this
.
watches
.
forEach
((
w
)
=>
w
.
dispose
());
this
.
watches
.
clear
();
this
.
watches
.
clear
();
super
.
dispose
();
super
.
dispose
();
...
@@ -263,6 +263,7 @@ export class ExtensionEnvironmentChannel implements IServerChannel {
...
@@ -263,6 +263,7 @@ export class ExtensionEnvironmentChannel implements IServerChannel {
globalStorageHome
:
this
.
environment
.
globalStorageHome
,
globalStorageHome
:
this
.
environment
.
globalStorageHome
,
workspaceStorageHome
:
this
.
environment
.
workspaceStorageHome
,
workspaceStorageHome
:
this
.
environment
.
workspaceStorageHome
,
userHome
:
this
.
environment
.
userHome
,
userHome
:
this
.
environment
.
userHome
,
useHostProxy
:
false
,
os
:
platform
.
OS
,
os
:
platform
.
OS
,
marks
:
[]
marks
:
[]
};
};
...
@@ -382,7 +383,7 @@ class VariableResolverService extends AbstractVariableResolverService {
...
@@ -382,7 +383,7 @@ class VariableResolverService extends AbstractVariableResolverService {
getLineNumber
:
():
string
|
undefined
=>
{
getLineNumber
:
():
string
|
undefined
=>
{
return
args
.
resolvedVariables
.
selectedText
;
return
args
.
resolvedVariables
.
selectedText
;
},
},
},
undefined
,
env
);
},
undefined
,
Promise
.
resolve
(
env
)
);
}
}
}
}
...
@@ -442,6 +443,7 @@ class Terminal extends TerminalProcess {
...
@@ -442,6 +443,7 @@ class Terminal extends TerminalProcess {
workspaceId
:
this
.
workspaceId
,
workspaceId
:
this
.
workspaceId
,
workspaceName
:
this
.
workspaceName
,
workspaceName
:
this
.
workspaceName
,
isOrphan
:
this
.
isOrphan
,
isOrphan
:
this
.
isOrphan
,
icon
:
'
bash
'
// TODO@oxy: currently unused by vscode
};
};
}
}
}
}
...
@@ -472,8 +474,7 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
...
@@ -472,8 +474,7 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
// Buffer to reduce the number of messages going to the renderer.
// Buffer to reduce the number of messages going to the renderer.
private
readonly
bufferer
=
new
TerminalDataBufferer
((
id
,
data
)
=>
{
private
readonly
bufferer
=
new
TerminalDataBufferer
((
id
,
data
)
=>
{
// TODO: Not sure what sync means.
this
.
_onProcessData
.
fire
({
id
,
event
:
data
});
this
.
_onProcessData
.
fire
({
id
,
event
:
{
data
,
sync
:
true
}});
});
});
public
constructor
(
private
readonly
logService
:
ILogService
)
{}
public
constructor
(
private
readonly
logService
:
ILogService
)
{}
...
@@ -564,27 +565,26 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
...
@@ -564,27 +565,26 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
toResource
:
(
relativePath
:
string
)
=>
resources
.
joinPath
(
activeWorkspaceUri
,
relativePath
),
toResource
:
(
relativePath
:
string
)
=>
resources
.
joinPath
(
activeWorkspaceUri
,
relativePath
),
}
:
undefined
;
}
:
undefined
;
const
resolverService
=
new
VariableResolverService
(
remoteAuthority
,
args
,
process
.
env
as
platform
.
IProcessEnvironment
);
const
resolverService
=
new
VariableResolverService
(
remoteAuthority
,
args
,
process
.
env
);
const
resolver
=
terminalEnvironment
.
createVariableResolver
(
activeWorkspace
,
resolverService
);
const
resolver
=
terminalEnvironment
.
createVariableResolver
(
activeWorkspace
,
process
.
env
,
resolverService
);
const
getDefaultShellAndArgs
=
async
():
Promise
<
{
executable
:
string
;
args
:
string
[]
|
string
}
>
=>
{
const
getDefaultShellAndArgs
=
async
():
Promise
<
{
executable
:
string
;
args
:
string
[]
|
string
}
>
=>
{
if
(
shellLaunchConfig
.
executable
)
{
if
(
shellLaunchConfig
.
executable
)
{
const
executable
=
resolverService
.
resolve
(
activeWorkspace
,
shellLaunchConfig
.
executable
);
const
executable
=
await
resolverService
.
resolveAsync
(
activeWorkspace
,
shellLaunchConfig
.
executable
);
let
resolvedArgs
:
string
[]
|
string
=
[];
let
resolvedArgs
:
string
[]
|
string
=
[];
if
(
shellLaunchConfig
.
args
&&
Array
.
isArray
(
shellLaunchConfig
.
args
))
{
if
(
shellLaunchConfig
.
args
&&
Array
.
isArray
(
shellLaunchConfig
.
args
))
{
for
(
const
arg
of
shellLaunchConfig
.
args
)
{
for
(
const
arg
of
shellLaunchConfig
.
args
)
{
resolvedArgs
.
push
(
resolverService
.
resolve
(
activeWorkspace
,
arg
));
resolvedArgs
.
push
(
await
resolverService
.
resolveAsync
(
activeWorkspace
,
arg
));
}
}
}
else
if
(
shellLaunchConfig
.
args
)
{
}
else
if
(
shellLaunchConfig
.
args
)
{
resolvedArgs
=
resolverService
.
resolve
(
activeWorkspace
,
shellLaunchConfig
.
args
);
resolvedArgs
=
await
resolverService
.
resolveAsync
(
activeWorkspace
,
shellLaunchConfig
.
args
);
}
}
return
{
executable
,
args
:
resolvedArgs
};
return
{
executable
,
args
:
resolvedArgs
};
}
}
const
executable
=
terminalEnvironment
.
getDefaultShell
(
const
executable
=
terminalEnvironment
.
getDefaultShell
(
(
key
)
=>
args
.
configuration
[
key
],
(
key
)
=>
args
.
configuration
[
key
],
args
.
isWorkspaceShellAllowed
,
await
getSystemShell
(
platform
.
OS
,
process
.
env
as
platform
.
IProcessEnvironment
),
await
getSystemShell
(
platform
.
platform
,
process
.
env
as
platform
.
IProcessEnvironment
),
process
.
env
.
hasOwnProperty
(
'
PROCESSOR_ARCHITEW6432
'
),
process
.
env
.
hasOwnProperty
(
'
PROCESSOR_ARCHITEW6432
'
),
process
.
env
.
windir
,
process
.
env
.
windir
,
resolver
,
resolver
,
...
@@ -594,7 +594,6 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
...
@@ -594,7 +594,6 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
const
resolvedArgs
=
terminalEnvironment
.
getDefaultShellArgs
(
const
resolvedArgs
=
terminalEnvironment
.
getDefaultShellArgs
(
(
key
)
=>
args
.
configuration
[
key
],
(
key
)
=>
args
.
configuration
[
key
],
args
.
isWorkspaceShellAllowed
,
false
,
// useAutomationShell
false
,
// useAutomationShell
resolver
,
resolver
,
this
.
logService
,
this
.
logService
,
...
@@ -625,7 +624,7 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
...
@@ -625,7 +624,7 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
logger
.
debug
(
'
Resolved shell launch configuration
'
,
field
(
'
id
'
,
terminalId
));
logger
.
debug
(
'
Resolved shell launch configuration
'
,
field
(
'
id
'
,
terminalId
));
// Use instead of `terminal.integrated.env.${platform}` to make types work.
// Use instead of `terminal.integrated.env.${platform}` to make types work.
const
getEnvFromConfig
=
():
terminal
.
ISingleTerminalConfiguration
<
ITerminalEnvironment
>
=>
{
const
getEnvFromConfig
=
():
ITerminalEnvironment
=>
{
if
(
platform
.
isWindows
)
{
if
(
platform
.
isWindows
)
{
return
args
.
configuration
[
'
terminal.integrated.env.windows
'
];
return
args
.
configuration
[
'
terminal.integrated.env.windows
'
];
}
else
if
(
platform
.
isMacintosh
)
{
}
else
if
(
platform
.
isMacintosh
)
{
...
@@ -635,7 +634,7 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
...
@@ -635,7 +634,7 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
};
};
const
getNonInheritedEnv
=
async
():
Promise
<
platform
.
IProcessEnvironment
>
=>
{
const
getNonInheritedEnv
=
async
():
Promise
<
platform
.
IProcessEnvironment
>
=>
{
const
env
=
await
getMainProcessParentEnv
();
const
env
=
await
getMainProcessParentEnv
(
process
.
env
);
env
.
VSCODE_IPC_HOOK_CLI
=
process
.
env
[
'
VSCODE_IPC_HOOK_CLI
'
]
!
;
env
.
VSCODE_IPC_HOOK_CLI
=
process
.
env
[
'
VSCODE_IPC_HOOK_CLI
'
]
!
;
return
env
;
return
env
;
};
};
...
@@ -644,7 +643,6 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
...
@@ -644,7 +643,6 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
shellLaunchConfig
,
shellLaunchConfig
,
getEnvFromConfig
(),
getEnvFromConfig
(),
resolver
,
resolver
,
args
.
isWorkspaceShellAllowed
,
product
.
version
,
product
.
version
,
args
.
configuration
[
'
terminal.integrated.detectLocale
'
],
args
.
configuration
[
'
terminal.integrated.detectLocale
'
],
args
.
configuration
[
'
terminal.integrated.inheritEnv
'
]
!==
false
args
.
configuration
[
'
terminal.integrated.inheritEnv
'
]
!==
false
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录