Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
e4b5bccf
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,发现更多精彩内容 >>
提交
e4b5bccf
编写于
4月 15, 2019
作者:
D
Daniel Imms
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve terminal launch
上级
94ba9cfe
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
31 addition
and
21 deletion
+31
-21
src/vs/workbench/api/browser/mainThreadTerminalService.ts
src/vs/workbench/api/browser/mainThreadTerminalService.ts
+2
-0
src/vs/workbench/contrib/terminal/browser/terminalService.ts
src/vs/workbench/contrib/terminal/browser/terminalService.ts
+3
-1
src/vs/workbench/contrib/terminal/common/terminal.ts
src/vs/workbench/contrib/terminal/common/terminal.ts
+1
-0
src/vs/workbench/contrib/terminal/common/terminalProcessExtHostProxy.ts
...ch/contrib/terminal/common/terminalProcessExtHostProxy.ts
+2
-9
src/vs/workbench/contrib/terminal/common/terminalService.ts
src/vs/workbench/contrib/terminal/common/terminalService.ts
+19
-9
src/vs/workbench/contrib/terminal/electron-browser/terminalService.ts
...ench/contrib/terminal/electron-browser/terminalService.ts
+4
-2
未找到文件。
src/vs/workbench/api/browser/mainThreadTerminalService.ts
浏览文件 @
e4b5bccf
...
...
@@ -51,6 +51,8 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
if
(
activeInstance
)
{
this
.
_proxy
.
$acceptActiveTerminalChanged
(
activeInstance
.
id
);
}
this
.
terminalService
.
extHostReady
(
extHostContext
.
remoteAuthority
);
}
public
dispose
():
void
{
...
...
src/vs/workbench/contrib/terminal/browser/terminalService.ts
浏览文件 @
e4b5bccf
...
...
@@ -22,6 +22,7 @@ import { IExtensionService } from 'vs/workbench/services/extensions/common/exten
import
{
IFileService
}
from
'
vs/platform/files/common/files
'
;
import
{
TerminalInstance
}
from
'
vs/workbench/contrib/terminal/browser/terminalInstance
'
;
import
{
IBrowserTerminalConfigHelper
}
from
'
vs/workbench/contrib/terminal/browser/terminal
'
;
import
{
IRemoteAgentService
}
from
'
vs/workbench/services/remote/common/remoteAgentService
'
;
export
abstract
class
TerminalService
extends
CommonTerminalService
implements
ITerminalService
{
protected
_configHelper
:
IBrowserTerminalConfigHelper
;
...
...
@@ -38,8 +39,9 @@ export abstract class TerminalService extends CommonTerminalService implements I
@
IWorkbenchEnvironmentService
private
_environmentService
:
IWorkbenchEnvironmentService
,
@
IExtensionService
extensionService
:
IExtensionService
,
@
IFileService
fileService
:
IFileService
,
@
IRemoteAgentService
remoteAgentService
:
IRemoteAgentService
)
{
super
(
contextKeyService
,
panelService
,
lifecycleService
,
storageService
,
notificationService
,
dialogService
,
extensionService
,
fileService
);
super
(
contextKeyService
,
panelService
,
lifecycleService
,
storageService
,
notificationService
,
dialogService
,
extensionService
,
fileService
,
remoteAgentService
);
}
protected
abstract
_getDefaultShell
(
p
:
platform
.
Platform
):
string
;
...
...
src/vs/workbench/contrib/terminal/common/terminal.ts
浏览文件 @
e4b5bccf
...
...
@@ -267,6 +267,7 @@ 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
):
void
;
}
...
...
src/vs/workbench/contrib/terminal/common/terminalProcessExtHostProxy.ts
浏览文件 @
e4b5bccf
...
...
@@ -7,7 +7,6 @@ import { Event, Emitter } from 'vs/base/common/event';
import
{
ITerminalService
,
ITerminalProcessExtHostProxy
,
IShellLaunchConfig
,
ITerminalChildProcess
}
from
'
vs/workbench/contrib/terminal/common/terminal
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
IExtensionService
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
export
class
TerminalProcessExtHostProxy
implements
ITerminalChildProcess
,
ITerminalProcessExtHostProxy
{
private
_disposables
:
IDisposable
[]
=
[];
...
...
@@ -44,15 +43,9 @@ export class TerminalProcessExtHostProxy implements ITerminalChildProcess, ITerm
activeWorkspaceRootUri
:
URI
,
cols
:
number
,
rows
:
number
,
@
ITerminalService
private
readonly
_terminalService
:
ITerminalService
,
@
IExtensionService
private
readonly
_extensionService
:
IExtensionService
@
ITerminalService
private
readonly
_terminalService
:
ITerminalService
)
{
this
.
_extensionService
.
whenInstalledExtensionsRegistered
().
then
(()
=>
{
// TODO: MainThreadTerminalService is not ready at this point, fix this
setTimeout
(()
=>
{
this
.
_terminalService
.
requestExtHostProcess
(
this
,
shellLaunchConfig
,
activeWorkspaceRootUri
,
cols
,
rows
);
},
0
);
});
}
public
dispose
():
void
{
...
...
src/vs/workbench/contrib/terminal/common/terminalService.ts
浏览文件 @
e4b5bccf
...
...
@@ -19,6 +19,8 @@ import { IFileService } from 'vs/platform/files/common/files';
import
{
escapeNonWindowsPath
}
from
'
vs/workbench/contrib/terminal/common/terminalEnvironment
'
;
import
{
isWindows
}
from
'
vs/base/common/platform
'
;
import
{
basename
}
from
'
vs/base/common/path
'
;
import
{
IRemoteAgentService
}
from
'
vs/workbench/services/remote/common/remoteAgentService
'
;
import
{
timeout
}
from
'
vs/base/common/async
'
;
export
abstract
class
TerminalService
implements
ITerminalService
{
public
_serviceBrand
:
any
;
...
...
@@ -32,7 +34,7 @@ export abstract class TerminalService implements ITerminalService {
return
this
.
_terminalTabs
.
reduce
((
p
,
c
)
=>
p
.
concat
(
c
.
terminalInstances
),
<
ITerminalInstance
[]
>
[]);
}
private
_findState
:
FindReplaceState
;
private
_extHostsReady
:
{
[
authority
:
string
]:
boolean
}
=
{};
private
_activeTabIndex
:
number
;
public
get
activeTabIndex
():
number
{
return
this
.
_activeTabIndex
;
}
...
...
@@ -65,12 +67,13 @@ export abstract class TerminalService implements ITerminalService {
constructor
(
@
IContextKeyService
private
readonly
_contextKeyService
:
IContextKeyService
,
@
IPanelService
protected
readonly
_panelService
:
IPanelService
,
@
ILifecycleService
lifecycleService
:
ILifecycleService
,
@
ILifecycleService
readonly
lifecycleService
:
ILifecycleService
,
@
IStorageService
protected
readonly
_storageService
:
IStorageService
,
@
INotificationService
protected
readonly
_notificationService
:
INotificationService
,
@
IDialogService
private
readonly
_dialogService
:
IDialogService
,
@
IExtensionService
private
readonly
_extensionService
:
IExtensionService
,
@
IFileService
protected
readonly
_fileService
:
IFileService
@
IFileService
protected
readonly
_fileService
:
IFileService
,
@
IRemoteAgentService
readonly
_remoteAgentService
:
IRemoteAgentService
)
{
this
.
_activeTabIndex
=
0
;
this
.
_isShuttingDown
=
false
;
...
...
@@ -116,15 +119,22 @@ export abstract class TerminalService implements ITerminalService {
}
public
requestExtHostProcess
(
proxy
:
ITerminalProcessExtHostProxy
,
shellLaunchConfig
:
IShellLaunchConfig
,
activeWorkspaceRootUri
:
URI
,
cols
:
number
,
rows
:
number
):
void
{
// Ensure extension host is ready before requesting a process
this
.
_extensionService
.
whenInstalledExtensionsRegistered
().
then
(()
=>
{
// TODO: MainThreadTerminalService is not ready at this point, fix this
setTimeout
(()
=>
{
this
.
_extensionService
.
whenInstalledExtensionsRegistered
().
then
(
async
()
=>
{
// Wait for the remoteAuthority to be ready (and listening for events) before proceeding
const
conn
=
this
.
_remoteAgentService
.
getConnection
();
const
remoteAuthority
=
conn
?
conn
.
remoteAuthority
:
'
null
'
;
let
retries
=
0
;
while
(
!
this
.
_extHostsReady
[
remoteAuthority
]
&&
++
retries
<
50
)
{
await
timeout
(
100
);
}
this
.
_onInstanceRequestExtHostProcess
.
fire
({
proxy
,
shellLaunchConfig
,
activeWorkspaceRootUri
,
cols
,
rows
});
},
500
);
});
}
public
extHostReady
(
remoteAuthority
:
string
):
void
{
this
.
_extHostsReady
[
remoteAuthority
]
=
true
;
}
private
_onBeforeShutdown
():
boolean
|
Promise
<
boolean
>
{
if
(
this
.
terminalInstances
.
length
===
0
)
{
// No terminal instances, don't veto
...
...
src/vs/workbench/contrib/terminal/electron-browser/terminalService.ts
浏览文件 @
e4b5bccf
...
...
@@ -28,6 +28,7 @@ import { IFileService } from 'vs/platform/files/common/files';
import
{
escapeNonWindowsPath
}
from
'
vs/workbench/contrib/terminal/common/terminalEnvironment
'
;
import
{
execFile
}
from
'
child_process
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
IRemoteAgentService
}
from
'
vs/workbench/services/remote/common/remoteAgentService
'
;
export
class
TerminalService
extends
BrowserTerminalService
implements
ITerminalService
{
public
get
configHelper
():
ITerminalConfigHelper
{
return
this
.
_configHelper
;
}
...
...
@@ -45,9 +46,10 @@ export class TerminalService extends BrowserTerminalService implements ITerminal
@
IDialogService
dialogService
:
IDialogService
,
@
IExtensionService
extensionService
:
IExtensionService
,
@
IWorkbenchEnvironmentService
environmentService
:
IWorkbenchEnvironmentService
,
@
IFileService
fileService
:
IFileService
@
IFileService
fileService
:
IFileService
,
@
IRemoteAgentService
remoteAgentService
:
IRemoteAgentService
)
{
super
(
contextKeyService
,
panelService
,
layoutService
,
lifecycleService
,
storageService
,
notificationService
,
dialogService
,
instantiationService
,
environmentService
,
extensionService
,
fileService
);
super
(
contextKeyService
,
panelService
,
layoutService
,
lifecycleService
,
storageService
,
notificationService
,
dialogService
,
instantiationService
,
environmentService
,
extensionService
,
fileService
,
remoteAgentService
);
this
.
_configHelper
=
this
.
_instantiationService
.
createInstance
(
TerminalConfigHelper
,
linuxDistro
);
ipc
.
on
(
'
vscode:openFiles
'
,
(
_event
:
any
,
request
:
IOpenFileRequest
)
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录