Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
9b60caf9
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,发现更多精彩内容 >>
提交
9b60caf9
编写于
7月 25, 2019
作者:
D
Daniel Imms
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve naming of start/spawn request calls
上级
3866deba
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
25 addition
and
26 deletion
+25
-26
src/vs/workbench/api/browser/mainThreadTerminalService.ts
src/vs/workbench/api/browser/mainThreadTerminalService.ts
+6
-6
src/vs/workbench/api/common/extHost.protocol.ts
src/vs/workbench/api/common/extHost.protocol.ts
+1
-1
src/vs/workbench/api/node/extHostTerminalService.ts
src/vs/workbench/api/node/extHostTerminalService.ts
+1
-1
src/vs/workbench/contrib/terminal/common/terminal.ts
src/vs/workbench/contrib/terminal/common/terminal.ts
+6
-6
src/vs/workbench/contrib/terminal/common/terminalProcessExtHostProxy.ts
...ch/contrib/terminal/common/terminalProcessExtHostProxy.ts
+2
-3
src/vs/workbench/contrib/terminal/common/terminalService.ts
src/vs/workbench/contrib/terminal/common/terminalService.ts
+9
-9
未找到文件。
src/vs/workbench/api/browser/mainThreadTerminalService.ts
浏览文件 @
9b60caf9
...
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
{
IDisposable
,
DisposableStore
}
from
'
vs/base/common/lifecycle
'
;
import
{
ITerminalService
,
ITerminalInstance
,
IShellLaunchConfig
,
ITerminalProcessExtHostProxy
,
I
TerminalProcessExtHostRequest
,
ITerminalDimensions
,
EXT_HOST_CREATION_DELAY
,
IAvailableShellsRequest
,
IDefaultShellAndArgsRequest
,
I
ExtensionTerminalRequest
}
from
'
vs/workbench/contrib/terminal/common/terminal
'
;
import
{
ITerminalService
,
ITerminalInstance
,
IShellLaunchConfig
,
ITerminalProcessExtHostProxy
,
I
SpawnExtHostProcessRequest
,
ITerminalDimensions
,
EXT_HOST_CREATION_DELAY
,
IAvailableShellsRequest
,
IDefaultShellAndArgsRequest
,
IStart
ExtensionTerminalRequest
}
from
'
vs/workbench/contrib/terminal/common/terminal
'
;
import
{
ExtHostContext
,
ExtHostTerminalServiceShape
,
MainThreadTerminalServiceShape
,
MainContext
,
IExtHostContext
,
ShellLaunchConfigDto
,
TerminalLaunchConfig
,
ITerminalDimensionsDto
}
from
'
vs/workbench/api/common/extHost.protocol
'
;
import
{
extHostNamedCustomer
}
from
'
vs/workbench/api/common/extHostCustomers
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
...
...
@@ -47,8 +47,8 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
this
.
_toDispose
.
add
(
_terminalService
.
onInstanceProcessIdReady
(
instance
=>
this
.
_onTerminalProcessIdReady
(
instance
)));
this
.
_toDispose
.
add
(
_terminalService
.
onInstanceDimensionsChanged
(
instance
=>
this
.
_onInstanceDimensionsChanged
(
instance
)));
this
.
_toDispose
.
add
(
_terminalService
.
onInstanceMaximumDimensionsChanged
(
instance
=>
this
.
_onInstanceMaximumDimensionsChanged
(
instance
)));
this
.
_toDispose
.
add
(
_terminalService
.
onInstanceRequest
ExtHostProcess
(
request
=>
this
.
_onTerminalRequest
ExtHostProcess
(
request
)));
this
.
_toDispose
.
add
(
_terminalService
.
onInstanceRequest
ExtensionTerminal
(
e
=>
this
.
_onTerminalReques
tExtensionTerminal
(
e
)));
this
.
_toDispose
.
add
(
_terminalService
.
onInstanceRequest
SpawnExtHostProcess
(
request
=>
this
.
_onRequestSpawn
ExtHostProcess
(
request
)));
this
.
_toDispose
.
add
(
_terminalService
.
onInstanceRequest
StartExtensionTerminal
(
e
=>
this
.
_onRequestStar
tExtensionTerminal
(
e
)));
this
.
_toDispose
.
add
(
_terminalService
.
onActiveInstanceChanged
(
instance
=>
this
.
_onActiveTerminalChanged
(
instance
?
instance
.
id
:
null
)));
this
.
_toDispose
.
add
(
_terminalService
.
onInstanceTitleChanged
(
instance
=>
this
.
_onTitleChanged
(
instance
.
id
,
instance
.
title
)));
this
.
_toDispose
.
add
(
_terminalService
.
configHelper
.
onWorkspacePermissionsChanged
(
isAllowed
=>
this
.
_onWorkspacePermissionsChanged
(
isAllowed
)));
...
...
@@ -240,7 +240,7 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
this
.
_proxy
.
$acceptTerminalMaximumDimensions
(
instance
.
id
,
instance
.
maxCols
,
instance
.
maxRows
);
}
private
_on
TerminalRequestExtHostProcess
(
request
:
ITerminalProcessExtHost
Request
):
void
{
private
_on
RequestSpawnExtHostProcess
(
request
:
ISpawnExtHostProcess
Request
):
void
{
// Only allow processes on remote ext hosts
if
(
!
this
.
_remoteAuthority
)
{
return
;
...
...
@@ -261,7 +261,7 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
cwd
:
request
.
shellLaunchConfig
.
cwd
,
env
:
request
.
shellLaunchConfig
.
env
};
this
.
_proxy
.
$
create
Process
(
proxy
.
terminalId
,
shellLaunchConfigDto
,
request
.
activeWorkspaceRootUri
,
request
.
cols
,
request
.
rows
,
request
.
isWorkspaceShellAllowed
);
this
.
_proxy
.
$
spawnExtHost
Process
(
proxy
.
terminalId
,
shellLaunchConfigDto
,
request
.
activeWorkspaceRootUri
,
request
.
cols
,
request
.
rows
,
request
.
isWorkspaceShellAllowed
);
proxy
.
onInput
(
data
=>
this
.
_proxy
.
$acceptProcessInput
(
proxy
.
terminalId
,
data
));
proxy
.
onResize
(
dimensions
=>
this
.
_proxy
.
$acceptProcessResize
(
proxy
.
terminalId
,
dimensions
.
cols
,
dimensions
.
rows
));
proxy
.
onShutdown
(
immediate
=>
this
.
_proxy
.
$acceptProcessShutdown
(
proxy
.
terminalId
,
immediate
));
...
...
@@ -270,7 +270,7 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
proxy
.
onRequestLatency
(()
=>
this
.
_onRequestLatency
(
proxy
.
terminalId
));
}
private
_on
TerminalRequestExtensionTerminal
(
request
:
I
ExtensionTerminalRequest
):
void
{
private
_on
RequestStartExtensionTerminal
(
request
:
IStart
ExtensionTerminalRequest
):
void
{
const
proxy
=
request
.
proxy
;
const
ready
=
this
.
_terminalProcessesReady
.
get
(
proxy
.
terminalId
);
if
(
!
ready
)
{
...
...
src/vs/workbench/api/common/extHost.protocol.ts
浏览文件 @
9b60caf9
...
...
@@ -1161,7 +1161,7 @@ export interface ExtHostTerminalServiceShape {
$acceptTerminalTitleChange
(
id
:
number
,
name
:
string
):
void
;
$acceptTerminalDimensions
(
id
:
number
,
cols
:
number
,
rows
:
number
):
void
;
$acceptTerminalMaximumDimensions
(
id
:
number
,
cols
:
number
,
rows
:
number
):
void
;
$
create
Process
(
id
:
number
,
shellLaunchConfig
:
ShellLaunchConfigDto
,
activeWorkspaceRootUri
:
UriComponents
,
cols
:
number
,
rows
:
number
,
isWorkspaceShellAllowed
:
boolean
):
void
;
$
spawnExtHost
Process
(
id
:
number
,
shellLaunchConfig
:
ShellLaunchConfigDto
,
activeWorkspaceRootUri
:
UriComponents
,
cols
:
number
,
rows
:
number
,
isWorkspaceShellAllowed
:
boolean
):
void
;
$startExtensionTerminal
(
id
:
number
,
initialDimensions
:
ITerminalDimensionsDto
|
undefined
):
void
;
$acceptProcessInput
(
id
:
number
,
data
:
string
):
void
;
$acceptProcessResize
(
id
:
number
,
cols
:
number
,
rows
:
number
):
void
;
...
...
src/vs/workbench/api/node/extHostTerminalService.ts
浏览文件 @
9b60caf9
...
...
@@ -550,7 +550,7 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape {
this
.
_variableResolver
=
new
ExtHostVariableResolverService
(
workspaceFolders
||
[],
this
.
_extHostDocumentsAndEditors
,
configProvider
);
}
public
async
$
create
Process
(
id
:
number
,
shellLaunchConfigDto
:
ShellLaunchConfigDto
,
activeWorkspaceRootUriComponents
:
UriComponents
,
cols
:
number
,
rows
:
number
,
isWorkspaceShellAllowed
:
boolean
):
Promise
<
void
>
{
public
async
$
spawnExtHost
Process
(
id
:
number
,
shellLaunchConfigDto
:
ShellLaunchConfigDto
,
activeWorkspaceRootUriComponents
:
UriComponents
,
cols
:
number
,
rows
:
number
,
isWorkspaceShellAllowed
:
boolean
):
Promise
<
void
>
{
const
shellLaunchConfig
:
IShellLaunchConfig
=
{
name
:
shellLaunchConfigDto
.
name
,
executable
:
shellLaunchConfigDto
.
executable
,
...
...
src/vs/workbench/contrib/terminal/common/terminal.ts
浏览文件 @
9b60caf9
...
...
@@ -231,8 +231,8 @@ export interface ITerminalService {
onInstanceProcessIdReady
:
Event
<
ITerminalInstance
>
;
onInstanceDimensionsChanged
:
Event
<
ITerminalInstance
>
;
onInstanceMaximumDimensionsChanged
:
Event
<
ITerminalInstance
>
;
onInstanceRequest
ExtHostProcess
:
Event
<
ITerminalProcessExtHost
Request
>
;
onInstanceRequest
ExtensionTerminal
:
Event
<
I
ExtensionTerminalRequest
>
;
onInstanceRequest
SpawnExtHostProcess
:
Event
<
ISpawnExtHostProcess
Request
>
;
onInstanceRequest
StartExtensionTerminal
:
Event
<
IStart
ExtensionTerminalRequest
>
;
onInstancesChanged
:
Event
<
void
>
;
onInstanceTitleChanged
:
Event
<
ITerminalInstance
>
;
onActiveInstanceChanged
:
Event
<
ITerminalInstance
|
undefined
>
;
...
...
@@ -299,8 +299,8 @@ export interface ITerminalService {
preparePathForTerminalAsync
(
path
:
string
,
executable
:
string
|
undefined
,
title
:
string
):
Promise
<
string
>
;
extHostReady
(
remoteAuthority
:
string
):
void
;
requestExtHostProcess
(
proxy
:
ITerminalProcessExtHostProxy
,
shellLaunchConfig
:
IShellLaunchConfig
,
activeWorkspaceRootUri
:
URI
,
cols
:
number
,
rows
:
number
,
isWorkspaceShellAllowed
:
boolean
):
void
;
requestExtensionTerminal
(
proxy
:
ITerminalProcessExtHostProxy
,
cols
:
number
,
rows
:
number
):
void
;
request
Spawn
ExtHostProcess
(
proxy
:
ITerminalProcessExtHostProxy
,
shellLaunchConfig
:
IShellLaunchConfig
,
activeWorkspaceRootUri
:
URI
,
cols
:
number
,
rows
:
number
,
isWorkspaceShellAllowed
:
boolean
):
void
;
request
Start
ExtensionTerminal
(
proxy
:
ITerminalProcessExtHostProxy
,
cols
:
number
,
rows
:
number
):
void
;
}
/**
...
...
@@ -760,7 +760,7 @@ export interface ITerminalProcessExtHostProxy extends IDisposable {
onRequestLatency
:
Event
<
void
>
;
}
export
interface
I
TerminalProcessExtHost
Request
{
export
interface
I
SpawnExtHostProcess
Request
{
proxy
:
ITerminalProcessExtHostProxy
;
shellLaunchConfig
:
IShellLaunchConfig
;
activeWorkspaceRootUri
:
URI
;
...
...
@@ -769,7 +769,7 @@ export interface ITerminalProcessExtHostRequest {
isWorkspaceShellAllowed
:
boolean
;
}
export
interface
IExtensionTerminalRequest
{
export
interface
I
Start
ExtensionTerminalRequest
{
proxy
:
ITerminalProcessExtHostProxy
;
cols
:
number
;
rows
:
number
;
...
...
src/vs/workbench/contrib/terminal/common/terminalProcessExtHostProxy.ts
浏览文件 @
9b60caf9
...
...
@@ -59,14 +59,13 @@ export class TerminalProcessExtHostProxy extends Disposable implements ITerminal
// Request a process if needed, if this is a virtual process this step can be skipped as
// there is no real "process" and we know it's ready on the ext host already.
if
(
shellLaunchConfig
.
isExtensionTerminal
)
{
// TODO: This name should be improved
this
.
_terminalService
.
requestExtensionTerminal
(
this
,
cols
,
rows
);
this
.
_terminalService
.
requestStartExtensionTerminal
(
this
,
cols
,
rows
);
}
else
{
remoteAgentService
.
getEnvironment
().
then
(
env
=>
{
if
(
!
env
)
{
throw
new
Error
(
'
Could not fetch environment
'
);
}
this
.
_terminalService
.
requestExtHostProcess
(
this
,
shellLaunchConfig
,
activeWorkspaceRootUri
,
cols
,
rows
,
configHelper
.
checkWorkspaceShellPermissions
(
env
.
os
));
this
.
_terminalService
.
request
Spawn
ExtHostProcess
(
this
,
shellLaunchConfig
,
activeWorkspaceRootUri
,
cols
,
rows
,
configHelper
.
checkWorkspaceShellPermissions
(
env
.
os
));
});
if
(
!
hasReceivedResponse
)
{
setTimeout
(()
=>
this
.
_onProcessTitleChanged
.
fire
(
nls
.
localize
(
'
terminal.integrated.starting
'
,
"
Starting...
"
)),
0
);
...
...
src/vs/workbench/contrib/terminal/common/terminalService.ts
浏览文件 @
9b60caf9
...
...
@@ -8,7 +8,7 @@ import { Event, Emitter } from 'vs/base/common/event';
import
{
IContextKeyService
,
IContextKey
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
ILifecycleService
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
IPanelService
}
from
'
vs/workbench/services/panel/common/panelService
'
;
import
{
ITerminalService
,
ITerminalInstance
,
IShellLaunchConfig
,
ITerminalConfigHelper
,
KEYBINDING_CONTEXT_TERMINAL_FOCUS
,
KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_VISIBLE
,
TERMINAL_PANEL_ID
,
ITerminalTab
,
ITerminalProcessExtHostProxy
,
I
TerminalProcessExtHostRequest
,
KEYBINDING_CONTEXT_TERMINAL_IS_OPEN
,
ITerminalNativeService
,
IShellDefinition
,
IAvailableShellsRequest
,
I
ExtensionTerminalRequest
}
from
'
vs/workbench/contrib/terminal/common/terminal
'
;
import
{
ITerminalService
,
ITerminalInstance
,
IShellLaunchConfig
,
ITerminalConfigHelper
,
KEYBINDING_CONTEXT_TERMINAL_FOCUS
,
KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_VISIBLE
,
TERMINAL_PANEL_ID
,
ITerminalTab
,
ITerminalProcessExtHostProxy
,
I
SpawnExtHostProcessRequest
,
KEYBINDING_CONTEXT_TERMINAL_IS_OPEN
,
ITerminalNativeService
,
IShellDefinition
,
IAvailableShellsRequest
,
IStart
ExtensionTerminalRequest
}
from
'
vs/workbench/contrib/terminal/common/terminal
'
;
import
{
IStorageService
}
from
'
vs/platform/storage/common/storage
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
FindReplaceState
}
from
'
vs/editor/contrib/find/findState
'
;
...
...
@@ -53,10 +53,10 @@ export abstract class TerminalService implements ITerminalService {
public
get
onInstanceDisposed
():
Event
<
ITerminalInstance
>
{
return
this
.
_onInstanceDisposed
.
event
;
}
protected
readonly
_onInstanceProcessIdReady
=
new
Emitter
<
ITerminalInstance
>
();
public
get
onInstanceProcessIdReady
():
Event
<
ITerminalInstance
>
{
return
this
.
_onInstanceProcessIdReady
.
event
;
}
protected
readonly
_onInstanceRequest
ExtHostProcess
=
new
Emitter
<
ITerminalProcessExtHost
Request
>
();
public
get
onInstanceRequest
ExtHostProcess
():
Event
<
ITerminalProcessExtHostRequest
>
{
return
this
.
_onInstanceRequest
ExtHostProcess
.
event
;
}
protected
readonly
_onInstanceRequest
ExtensionTerminal
=
new
Emitter
<
I
ExtensionTerminalRequest
>
();
public
get
onInstanceRequest
ExtensionTerminal
():
Event
<
IExtensionTerminalRequest
>
{
return
this
.
_onInstanceReques
tExtensionTerminal
.
event
;
}
protected
readonly
_onInstanceRequest
SpawnExtHostProcess
=
new
Emitter
<
ISpawnExtHostProcess
Request
>
();
public
get
onInstanceRequest
SpawnExtHostProcess
():
Event
<
ISpawnExtHostProcessRequest
>
{
return
this
.
_onInstanceRequestSpawn
ExtHostProcess
.
event
;
}
protected
readonly
_onInstanceRequest
StartExtensionTerminal
=
new
Emitter
<
IStart
ExtensionTerminalRequest
>
();
public
get
onInstanceRequest
StartExtensionTerminal
():
Event
<
IStartExtensionTerminalRequest
>
{
return
this
.
_onInstanceRequestStar
tExtensionTerminal
.
event
;
}
protected
readonly
_onInstanceDimensionsChanged
=
new
Emitter
<
ITerminalInstance
>
();
public
get
onInstanceDimensionsChanged
():
Event
<
ITerminalInstance
>
{
return
this
.
_onInstanceDimensionsChanged
.
event
;
}
protected
readonly
_onInstanceMaximumDimensionsChanged
=
new
Emitter
<
ITerminalInstance
>
();
...
...
@@ -131,7 +131,7 @@ export abstract class TerminalService implements ITerminalService {
return
activeInstance
?
activeInstance
:
this
.
createTerminal
(
undefined
,
wasNewTerminalAction
);
}
public
requestExtHostProcess
(
proxy
:
ITerminalProcessExtHostProxy
,
shellLaunchConfig
:
IShellLaunchConfig
,
activeWorkspaceRootUri
:
URI
,
cols
:
number
,
rows
:
number
,
isWorkspaceShellAllowed
:
boolean
):
void
{
public
request
Spawn
ExtHostProcess
(
proxy
:
ITerminalProcessExtHostProxy
,
shellLaunchConfig
:
IShellLaunchConfig
,
activeWorkspaceRootUri
:
URI
,
cols
:
number
,
rows
:
number
,
isWorkspaceShellAllowed
:
boolean
):
void
{
this
.
_extensionService
.
whenInstalledExtensionsRegistered
().
then
(
async
()
=>
{
// Wait for the remoteAuthority to be ready (and listening for events) before proceeding
const
conn
=
this
.
_remoteAgentService
.
getConnection
();
...
...
@@ -140,12 +140,12 @@ export abstract class TerminalService implements ITerminalService {
while
(
!
this
.
_extHostsReady
[
remoteAuthority
]
&&
++
retries
<
50
)
{
await
timeout
(
100
);
}
this
.
_onInstanceRequestExtHostProcess
.
fire
({
proxy
,
shellLaunchConfig
,
activeWorkspaceRootUri
,
cols
,
rows
,
isWorkspaceShellAllowed
});
this
.
_onInstanceRequest
Spawn
ExtHostProcess
.
fire
({
proxy
,
shellLaunchConfig
,
activeWorkspaceRootUri
,
cols
,
rows
,
isWorkspaceShellAllowed
});
});
}
public
requestExtensionTerminal
(
proxy
:
ITerminalProcessExtHostProxy
,
cols
:
number
,
rows
:
number
):
void
{
this
.
_onInstanceRequestExtensionTerminal
.
fire
({
proxy
,
cols
,
rows
});
public
request
Start
ExtensionTerminal
(
proxy
:
ITerminalProcessExtHostProxy
,
cols
:
number
,
rows
:
number
):
void
{
this
.
_onInstanceRequest
Start
ExtensionTerminal
.
fire
({
proxy
,
cols
,
rows
});
}
public
extHostReady
(
remoteAuthority
:
string
):
void
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录