Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
71933350
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
71933350
编写于
6月 16, 2018
作者:
D
Daniel Imms
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Clean up
上级
f151c4ea
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
17 addition
and
9 deletion
+17
-9
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+14
-0
src/vs/workbench/api/node/extHostTerminalService.ts
src/vs/workbench/api/node/extHostTerminalService.ts
+3
-9
未找到文件。
src/vs/vscode.proposed.d.ts
浏览文件 @
71933350
...
...
@@ -363,6 +363,15 @@ declare module 'vscode' {
* Represents a terminal without a process where all interaction and output in the terminal is
* controlled by an extension. This is similar to an output window but has the same VT sequence
* compatility as the regular terminal.
*
* Note that an instance of [Terminal](#Terminal) will be created when a TerminalRenderer is
* created with all its APIs available for use by extensions. When using the Terminal object
* of a TerminalRenderer it acts just like normal only the extension that created the
* TerminalRenderer essentially acts as a process of a normal terminal. For example when
* an [Terminal.onData](#Terminal.onData) listener is registered, that will fire when
* [TerminalRenderer.write](#TerminalRenderer.write) is called. Similarly when
* [Terminal.sendText](#Terminal.sendText) is triggered that will fire the
* [TerminalRenderer.onInput](#TerminalRenderer.onInput) event.
*/
export
interface
TerminalRenderer
{
/**
...
...
@@ -431,6 +440,11 @@ declare module 'vscode' {
*/
export
const
onDidOpenTerminal
:
Event
<
Terminal
>
;
/**
* Create a [TerminalRenderer](#TerminalRenderer).
*
* @param name The name of the terminal renderer, this shows up in the terminal selector.
*/
export
function
createTerminalRenderer
(
name
:
string
):
TerminalRenderer
;
}
...
...
src/vs/workbench/api/node/extHostTerminalService.ts
浏览文件 @
71933350
...
...
@@ -17,7 +17,7 @@ import { ExtHostConfiguration } from 'vs/workbench/api/node/extHostConfiguration
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
export
class
BaseExtHostTerminal
{
p
rotected
_id
:
number
;
p
ublic
_id
:
number
;
private
_disposed
:
boolean
=
false
;
private
_queuedRequests
:
ApiRequest
[]
=
[];
...
...
@@ -142,9 +142,6 @@ export class ExtHostTerminalRenderer extends BaseExtHostTerminal implements vsco
public
get
onInput
():
Event
<
string
>
{
this
.
_checkDisposed
();
this
.
_queueApiRequest
(
this
.
_proxy
.
$terminalRendererRegisterOnInputListener
,
[
this
.
_id
]);
// TODO: This is not firing on renderers as ExtHostTerminalService doesn't track them currently
console
.
log
(
'
TerminalRenderer.onInput id:
'
,
this
.
_id
);
// TODO: This needs to fire for keystrokes and sendText only for renderers
// Tell the main side to start sending data if it's not already
// this._proxy.$terminalRendererRegisterOnDataListener(this._id);
return
this
.
_onInput
&&
this
.
_onInput
.
event
;
...
...
@@ -156,7 +153,6 @@ export class ExtHostTerminalRenderer extends BaseExtHostTerminal implements vsco
this
.
_checkDisposed
();
this
.
_dimensions
=
dimensions
;
this
.
_queueApiRequest
(
this
.
_proxy
.
$terminalRendererSetDimensions
,
[
dimensions
]);
// TODO: Send overridden dimensions over to the terminal instance
}
private
_maximumDimensions
:
vscode
.
TerminalDimensions
;
...
...
@@ -398,8 +394,7 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape {
private
_getTerminalIndexById
(
id
:
number
):
number
{
let
index
:
number
=
null
;
this
.
_terminals
.
some
((
terminal
,
i
)
=>
{
// TODO: This shouldn't be cas
const
thisId
=
(
<
any
>
terminal
).
_id
;
const
thisId
=
terminal
.
_id
;
if
(
thisId
===
id
)
{
index
=
i
;
return
true
;
...
...
@@ -413,8 +408,7 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape {
private
_getTerminalRendererIndexById
(
id
:
number
):
number
{
let
index
:
number
=
null
;
this
.
_terminalRenderers
.
some
((
renderer
,
i
)
=>
{
// TODO: This shouldn't be cas
const
thisId
=
(
<
any
>
renderer
).
_id
;
const
thisId
=
renderer
.
_id
;
if
(
thisId
===
id
)
{
index
=
i
;
return
true
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录