Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
c8d58f42
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,发现更多精彩内容 >>
提交
c8d58f42
编写于
4月 17, 2018
作者:
D
Daniel Imms
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Pass through shutdown and resize
上级
a0e99bcb
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
37 addition
and
17 deletion
+37
-17
src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts
...rkbench/api/electron-browser/mainThreadTerminalService.ts
+3
-5
src/vs/workbench/api/node/extHost.protocol.ts
src/vs/workbench/api/node/extHost.protocol.ts
+3
-1
src/vs/workbench/api/node/extHostTerminalService.ts
src/vs/workbench/api/node/extHostTerminalService.ts
+10
-1
src/vs/workbench/parts/terminal/common/terminal.ts
src/vs/workbench/parts/terminal/common/terminal.ts
+2
-0
src/vs/workbench/parts/terminal/node/terminalProcessExtHostProxy.ts
...kbench/parts/terminal/node/terminalProcessExtHostProxy.ts
+19
-10
未找到文件。
src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts
浏览文件 @
c8d58f42
...
...
@@ -105,7 +105,9 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
this
.
_terminalProcesses
[
proxy
.
terminalId
]
=
proxy
;
this
.
_proxy
.
$createProcess
(
proxy
.
terminalId
,
null
,
0
,
0
);
// TODO: Dispose of this properly when the terminal/process dies
this
.
_toDispose
.
push
(
proxy
.
onInput
(
data
=>
this
.
_onTerminalProcessWrite
(
proxy
.
terminalId
,
data
)));
this
.
_toDispose
.
push
(
proxy
.
onInput
(
data
=>
this
.
_proxy
.
$acceptTerminalProcessInput
(
proxy
.
terminalId
,
data
)));
this
.
_toDispose
.
push
(
proxy
.
onResize
((
cols
,
rows
)
=>
this
.
_proxy
.
$acceptTerminalProcessResize
(
proxy
.
terminalId
,
cols
,
rows
)));
this
.
_toDispose
.
push
(
proxy
.
onShutdown
(()
=>
this
.
_proxy
.
$acceptTerminalProcessShutdown
(
proxy
.
terminalId
)));
}
public
$sendProcessTitle
(
terminalId
:
number
,
title
:
string
):
void
{
...
...
@@ -119,8 +121,4 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
public
$sendProcessPid
(
terminalId
:
number
,
pid
:
number
):
void
{
this
.
_terminalProcesses
[
terminalId
].
emitPid
(
pid
);
}
private
_onTerminalProcessWrite
(
terminalId
:
number
,
data
:
string
):
void
{
this
.
_proxy
.
$acceptTerminalProcessWrite
(
terminalId
,
data
);
}
}
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
c8d58f42
...
...
@@ -748,7 +748,9 @@ export interface ExtHostTerminalServiceShape {
$acceptTerminalOpened
(
id
:
number
,
name
:
string
):
void
;
$acceptTerminalProcessId
(
id
:
number
,
processId
:
number
):
void
;
$createProcess
(
id
:
number
,
shellLaunchConfig
:
ShellLaunchConfigDto
,
cols
:
number
,
rows
:
number
):
void
;
$acceptTerminalProcessWrite
(
id
:
number
,
data
:
string
):
void
;
$acceptTerminalProcessInput
(
id
:
number
,
data
:
string
):
void
;
$acceptTerminalProcessResize
(
id
:
number
,
cols
:
number
,
rows
:
number
):
void
;
$acceptTerminalProcessShutdown
(
id
:
number
):
void
;
}
export
interface
ExtHostSCMShape
{
...
...
src/vs/workbench/api/node/extHostTerminalService.ts
浏览文件 @
c8d58f42
...
...
@@ -212,10 +212,19 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape {
console
.
log
(
'
$createProcess terminal:
'
+
terminal
.
name
);
}
public
$acceptTerminalProcess
Write
(
id
:
number
,
data
:
string
):
void
{
public
$acceptTerminalProcess
Input
(
id
:
number
,
data
:
string
):
void
{
this
.
_terminalProcesses
[
id
].
send
({
event
:
'
input
'
,
data
});
}
public
$acceptTerminalProcessResize
(
id
:
number
,
cols
:
number
,
rows
:
number
):
void
{
console
.
log
(
'
resize
'
+
cols
+
'
,
'
+
rows
);
this
.
_terminalProcesses
[
id
].
send
({
event
:
'
resize
'
,
cols
,
rows
});
}
public
$acceptTerminalProcessShutdown
(
id
:
number
):
void
{
this
.
_terminalProcesses
[
id
].
send
({
event
:
'
shutdown
'
});
}
private
_getTerminalById
(
id
:
number
):
ExtHostTerminal
{
let
index
=
this
.
_getTerminalIndexById
(
id
);
return
index
!==
null
?
this
.
_terminals
[
index
]
:
null
;
...
...
src/vs/workbench/parts/terminal/common/terminal.ts
浏览文件 @
c8d58f42
...
...
@@ -530,4 +530,6 @@ export interface ITerminalProcessExtHostProxy {
emitTitle
(
title
:
string
):
void
;
emitPid
(
pid
:
number
):
void
;
onInput
(
listener
:
(
data
:
string
)
=>
void
):
IDisposable
;
onResize
(
listener
:
(
cols
:
number
,
rows
:
number
)
=>
void
):
IDisposable
;
onShutdown
(
listener
:
()
=>
void
):
IDisposable
;
}
src/vs/workbench/parts/terminal/node/terminalProcessExtHostProxy.ts
浏览文件 @
c8d58f42
...
...
@@ -9,7 +9,8 @@ import { ITerminalService, ITerminalProcessExtHostProxy } from 'vs/workbench/par
import
{
IDisposable
}
from
'
../../../../base/common/lifecycle
'
;
export
class
TerminalProcessExtHostProxy
extends
EventEmitter
implements
ITerminalChildProcess
,
ITerminalProcessExtHostProxy
{
public
connected
:
boolean
;
// TODO: Set this properly
public
connected
:
boolean
=
true
;
constructor
(
public
terminalId
:
number
,
...
...
@@ -32,21 +33,29 @@ export class TerminalProcessExtHostProxy extends EventEmitter implements ITermin
}
public
send
(
message
:
IMessageToTerminalProcess
):
boolean
{
console
.
log
(
'
TerminalProcessExtHostProxy#send
'
);
if
(
message
.
event
===
'
input
'
)
{
c
onsole
.
log
(
'
emit input
'
,
message
.
data
)
;
this
.
emit
(
'
input
'
,
message
.
data
)
;
switch
(
message
.
event
)
{
case
'
input
'
:
this
.
emit
(
'
input
'
,
message
.
data
);
break
;
c
ase
'
resize
'
:
this
.
emit
(
'
resize
'
,
message
.
cols
,
message
.
rows
);
break
;
case
'
shutdown
'
:
this
.
emit
(
'
shutdown
'
);
break
;
}
return
true
;
}
public
onInput
(
listener
:
(
data
:
string
)
=>
void
):
IDisposable
{
console
.
log
(
'
TerminalProcessExtHostProxy#onInput
'
,
arguments
);
// TODO: Dispose of me
this
.
on
(
'
input
'
,
data
=>
{
console
.
log
(
'
TerminalProcessExtHostProxy#onInput - listener
'
);
listener
(
data
);
});
this
.
on
(
'
input
'
,
data
=>
listener
(
data
));
return
null
;
}
public
onResize
(
listener
:
(
cols
:
number
,
rows
:
number
)
=>
void
):
IDisposable
{
// TODO: Dispose of me
this
.
on
(
'
resize
'
,
(
cols
,
rows
)
=>
listener
(
cols
,
rows
));
return
null
;
}
public
onShutdown
(
listener
:
()
=>
void
):
IDisposable
{
// TODO: Dispose of me
this
.
on
(
'
shutdown
'
,
()
=>
listener
());
return
null
;
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录