Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
ade7f5e8
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,发现更多精彩内容 >>
提交
ade7f5e8
编写于
4月 14, 2018
作者:
D
Daniel Imms
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Allow process not to be created
上级
b7cb0d0a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
24 addition
and
16 deletion
+24
-16
src/vs/workbench/parts/terminal/common/terminal.ts
src/vs/workbench/parts/terminal/common/terminal.ts
+0
-1
src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts
...bench/parts/terminal/electron-browser/terminalInstance.ts
+18
-11
src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts
...parts/terminal/electron-browser/terminalProcessManager.ts
+2
-2
src/vs/workbench/parts/terminal/electron-browser/terminalTab.ts
.../workbench/parts/terminal/electron-browser/terminalTab.ts
+4
-2
未找到文件。
src/vs/workbench/parts/terminal/common/terminal.ts
浏览文件 @
ade7f5e8
...
...
@@ -472,7 +472,6 @@ export interface ITerminalProcessManager extends IDisposable {
onShellProcessIdReady
:
Event
<
number
>
;
initialCwd
:
string
;
acceptProcessMessage
(
message
):
void
;
addDisposable
(
disposable
:
IDisposable
);
createProcess
(
shellLaunchConfig
:
IShellLaunchConfig
);
write
(
data
:
string
):
void
;
...
...
src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts
浏览文件 @
ade7f5e8
...
...
@@ -95,6 +95,7 @@ export class TerminalInstance implements ITerminalInstance {
private
_configHelper
:
TerminalConfigHelper
,
private
_container
:
HTMLElement
,
private
_shellLaunchConfig
:
IShellLaunchConfig
,
doCreateProcess
:
boolean
,
@
IContextKeyService
private
readonly
_contextKeyService
:
IContextKeyService
,
@
IKeybindingService
private
readonly
_keybindingService
:
IKeybindingService
,
@
INotificationService
private
readonly
_notificationService
:
INotificationService
,
...
...
@@ -119,18 +120,12 @@ export class TerminalInstance implements ITerminalInstance {
this
.
_logService
.
trace
(
`terminalInstance#ctor (id:
${
this
.
id
}
)`
,
this
.
_shellLaunchConfig
);
this
.
_initDimensions
();
this
.
_createProcess
();
if
(
doCreateProcess
)
{
this
.
_createProcess
();
}
this
.
_xtermReadyPromise
=
this
.
_createXterm
();
this
.
_xtermReadyPromise
.
then
(()
=>
{
if
(
platform
.
isWindows
)
{
this
.
_processManager
.
ptyProcessReady
.
then
(()
=>
{
if
(
!
this
.
_isDisposed
)
{
this
.
_windowsShellHelper
=
new
WindowsShellHelper
(
this
.
_processManager
.
shellProcessId
,
this
,
this
.
_xterm
);
}
});
}
// Only attach xterm.js to the DOM if the terminal panel has been opened before.
if
(
_container
)
{
this
.
_attachToElement
(
_container
);
...
...
@@ -269,8 +264,10 @@ export class TerminalInstance implements ITerminalInstance {
}
this
.
_xterm
.
winptyCompatInit
();
this
.
_xterm
.
on
(
'
linefeed
'
,
()
=>
this
.
_onLineFeed
());
this
.
_processManager
.
process
.
on
(
'
message
'
,
(
message
)
=>
this
.
_sendPtyDataToXterm
(
message
));
this
.
_xterm
.
on
(
'
data
'
,
data
=>
this
.
_processManager
.
write
(
data
));
if
(
this
.
_processManager
)
{
this
.
_processManager
.
process
.
on
(
'
message
'
,
(
message
)
=>
this
.
_sendPtyDataToXterm
(
message
));
this
.
_xterm
.
on
(
'
data
'
,
data
=>
this
.
_processManager
.
write
(
data
));
}
this
.
_linkHandler
=
this
.
_instantiationService
.
createInstance
(
TerminalLinkHandler
,
this
.
_xterm
,
platform
.
platform
,
this
.
_processManager
.
initialCwd
);
this
.
_commandTracker
=
new
TerminalCommandTracker
(
this
.
_xterm
);
this
.
_instanceDisposables
.
push
(
this
.
_themeService
.
onThemeChange
(
theme
=>
this
.
_updateTheme
(
theme
)));
...
...
@@ -611,6 +608,16 @@ export class TerminalInstance implements ITerminalInstance {
this
.
_processManager
.
process
.
on
(
'
message
'
,
this
.
_messageTitleListener
);
}
this
.
_processManager
.
process
.
on
(
'
exit
'
,
exitCode
=>
this
.
_onPtyProcessExit
(
exitCode
));
if
(
platform
.
isWindows
)
{
this
.
_processManager
.
ptyProcessReady
.
then
(()
=>
{
this
.
_xtermReadyPromise
.
then
(()
=>
{
if
(
!
this
.
_isDisposed
)
{
this
.
_windowsShellHelper
=
new
WindowsShellHelper
(
this
.
_processManager
.
shellProcessId
,
this
,
this
.
_xterm
);
}
});
});
}
}
private
_sendPtyDataToXterm
(
message
:
{
type
:
string
,
content
:
string
}):
void
{
...
...
src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts
浏览文件 @
ade7f5e8
...
...
@@ -100,7 +100,7 @@ export class TerminalProcessManager implements ITerminalProcessManager {
this
.
processState
=
ProcessState
.
LAUNCHING
;
// TODO: Hide message communication details inside terminal process manager
this
.
process
.
on
(
'
message
'
,
message
=>
this
.
accept
ProcessMessage
(
message
));
this
.
process
.
on
(
'
message
'
,
message
=>
this
.
_on
ProcessMessage
(
message
));
setTimeout
(()
=>
{
if
(
this
.
processState
===
ProcessState
.
LAUNCHING
)
{
...
...
@@ -150,7 +150,7 @@ export class TerminalProcessManager implements ITerminalProcessManager {
}
}
p
ublic
accept
ProcessMessage
(
message
:
ITerminalProcessMessage
):
void
{
p
rivate
_on
ProcessMessage
(
message
:
ITerminalProcessMessage
):
void
{
if
(
message
.
type
===
'
pid
'
)
{
this
.
shellProcessId
=
<
number
>
message
.
content
;
this
.
_onShellProcessIdReady
.
fire
(
this
.
shellProcessId
);
...
...
src/vs/workbench/parts/terminal/electron-browser/terminalTab.ts
浏览文件 @
ade7f5e8
...
...
@@ -270,7 +270,8 @@ export class TerminalTab extends Disposable implements ITerminalTab {
terminalFocusContextKey
,
configHelper
,
undefined
,
shellLaunchConfig
);
shellLaunchConfig
,
true
);
this
.
_terminalInstances
.
push
(
instance
);
this
.
_initInstanceListeners
(
instance
);
this
.
_activeInstanceIndex
=
0
;
...
...
@@ -399,7 +400,8 @@ export class TerminalTab extends Disposable implements ITerminalTab {
terminalFocusContextKey
,
configHelper
,
undefined
,
shellLaunchConfig
);
shellLaunchConfig
,
true
);
this
.
_terminalInstances
.
splice
(
this
.
_activeInstanceIndex
+
1
,
0
,
instance
);
this
.
_initInstanceListeners
(
instance
);
this
.
_setActiveInstance
(
instance
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录