Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
6a358f77
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,发现更多精彩内容 >>
提交
6a358f77
编写于
7月 24, 2019
作者:
D
Daniel Imms
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update types, fix debug logging and handler xterm calls
上级
f20eb762
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
44 addition
and
14 deletion
+44
-14
src/typings/xterm.d.ts
src/typings/xterm.d.ts
+42
-11
src/vs/platform/driver/electron-browser/driver.ts
src/vs/platform/driver/electron-browser/driver.ts
+1
-1
src/vs/workbench/contrib/terminal/browser/terminalInstance.ts
...vs/workbench/contrib/terminal/browser/terminalInstance.ts
+1
-2
未找到文件。
src/typings/xterm.d.ts
浏览文件 @
6a358f77
...
...
@@ -15,6 +15,11 @@ declare module 'xterm' {
*/
export
type
FontWeight
=
'
normal
'
|
'
bold
'
|
'
100
'
|
'
200
'
|
'
300
'
|
'
400
'
|
'
500
'
|
'
600
'
|
'
700
'
|
'
800
'
|
'
900
'
;
/**
* A string representing log level.
*/
export
type
LogLevel
=
'
debug
'
|
'
info
'
|
'
warn
'
|
'
error
'
|
'
off
'
;
/**
* A string representing a renderer type.
*/
...
...
@@ -107,6 +112,18 @@ declare module 'xterm' {
*/
lineHeight
?:
number
;
/**
* What log level to use, this will log for all levels below and including
* what is set:
*
* 1. debug
* 2. info (default)
* 3. warn
* 4. error
* 5. off
*/
logLevel
?:
LogLevel
;
/**
* Whether to treat option as the meta key.
*/
...
...
@@ -177,6 +194,12 @@ declare module 'xterm' {
* not whitespace.
*/
windowsMode
?:
boolean
;
/**
* A string containing all characters that are considered word separated by the
* double click to select work logic.
*/
wordSeparator
?:
string
;
}
/**
...
...
@@ -191,7 +214,7 @@ declare module 'xterm' {
cursor
?:
string
,
/** The accent color of the cursor (fg color for a block cursor) */
cursorAccent
?:
string
,
/** The selection color (can be transparent) */
/** The selection
background
color (can be transparent) */
selection
?:
string
,
/** ANSI black (eg. `\x1b[30m`) */
black
?:
string
,
...
...
@@ -483,12 +506,14 @@ declare module 'xterm' {
* final character (e.g "m" for SGR) of the CSI sequence.
* @param callback The function to handle the escape sequence. The callback
* is called with the numerical params, as well as the special characters
* (e.g. "$" for DECSCPP). Return true if the sequence was handled; false if
* (e.g. "$" for DECSCPP). If the sequence has subparams the array will
* contain subarrays with their numercial values.
* Return true if the sequence was handled; false if
* we should try a previous handler (set by addCsiHandler or setCsiHandler).
* The most recently-added handler is tried first.
* @return An IDisposable you can call to remove this handler.
*/
addCsiHandler
(
flag
:
string
,
callback
:
(
params
:
number
[],
collect
:
string
)
=>
boolean
):
IDisposable
;
addCsiHandler
(
flag
:
string
,
callback
:
(
params
:
(
number
|
number
[])
[],
collect
:
string
)
=>
boolean
):
IDisposable
;
/**
* (EXPERIMENTAL) Adds a handler for OSC escape sequences.
...
...
@@ -668,12 +693,12 @@ declare module 'xterm' {
* Retrieves an option's value from the terminal.
* @param key The option key.
*/
getOption
(
key
:
'
bellSound
'
|
'
bellStyle
'
|
'
cursorStyle
'
|
'
fontFamily
'
|
'
fontWeight
'
|
'
fontWeightBold
'
|
'
rendererType
'
|
'
termName
'
):
string
;
getOption
(
key
:
'
bellSound
'
|
'
bellStyle
'
|
'
cursorStyle
'
|
'
fontFamily
'
|
'
fontWeight
'
|
'
fontWeightBold
'
|
'
logLevel
'
|
'
rendererType
'
|
'
termName
'
|
'
wordSeparator
'
):
string
;
/**
* Retrieves an option's value from the terminal.
* @param key The option key.
*/
getOption
(
key
:
'
allowTransparency
'
|
'
cancelEvents
'
|
'
convertEol
'
|
'
cursorBlink
'
|
'
d
ebug
'
|
'
d
isableStdin
'
|
'
macOptionIsMeta
'
|
'
rightClickSelectsWord
'
|
'
popOnBell
'
|
'
screenKeys
'
|
'
useFlowControl
'
|
'
visualBell
'
|
'
windowsMode
'
):
boolean
;
getOption
(
key
:
'
allowTransparency
'
|
'
cancelEvents
'
|
'
convertEol
'
|
'
cursorBlink
'
|
'
disableStdin
'
|
'
macOptionIsMeta
'
|
'
rightClickSelectsWord
'
|
'
popOnBell
'
|
'
screenKeys
'
|
'
useFlowControl
'
|
'
visualBell
'
|
'
windowsMode
'
):
boolean
;
/**
* Retrieves an option's value from the terminal.
* @param key The option key.
...
...
@@ -700,13 +725,19 @@ declare module 'xterm' {
* @param key The option key.
* @param value The option value.
*/
setOption
(
key
:
'
fontFamily
'
|
'
termName
'
|
'
bellSound
'
,
value
:
string
):
void
;
setOption
(
key
:
'
fontFamily
'
|
'
termName
'
|
'
bellSound
'
|
'
wordSeparator
'
,
value
:
string
):
void
;
/**
* Sets an option on the terminal.
* @param key The option key.
* @param value The option value.
*/
setOption
(
key
:
'
fontWeight
'
|
'
fontWeightBold
'
,
value
:
null
|
'
normal
'
|
'
bold
'
|
'
100
'
|
'
200
'
|
'
300
'
|
'
400
'
|
'
500
'
|
'
600
'
|
'
700
'
|
'
800
'
|
'
900
'
):
void
;
/**
* Sets an option on the terminal.
* @param key The option key.
* @param value The option value.
*/
setOption
(
key
:
'
logLevel
'
,
value
:
LogLevel
):
void
;
/**
* Sets an option on the terminal.
* @param key The option key.
...
...
@@ -724,7 +755,7 @@ declare module 'xterm' {
* @param key The option key.
* @param value The option value.
*/
setOption
(
key
:
'
allowTransparency
'
|
'
cancelEvents
'
|
'
convertEol
'
|
'
cursorBlink
'
|
'
d
ebug
'
|
'
d
isableStdin
'
|
'
macOptionIsMeta
'
|
'
popOnBell
'
|
'
rightClickSelectsWord
'
|
'
screenKeys
'
|
'
useFlowControl
'
|
'
visualBell
'
|
'
windowsMode
'
,
value
:
boolean
):
void
;
setOption
(
key
:
'
allowTransparency
'
|
'
cancelEvents
'
|
'
convertEol
'
|
'
cursorBlink
'
|
'
disableStdin
'
|
'
macOptionIsMeta
'
|
'
popOnBell
'
|
'
rightClickSelectsWord
'
|
'
screenKeys
'
|
'
useFlowControl
'
|
'
visualBell
'
|
'
windowsMode
'
,
value
:
boolean
):
void
;
/**
* Sets an option on the terminal.
* @param key The option key.
...
...
@@ -929,16 +960,16 @@ declare module 'xterm' {
// Modifications to official .d.ts below
declare
module
'
xterm
'
{
interface
TerminalCore
{
debug
:
boolean
;
handler
(
text
:
string
):
void
;
_onScroll
:
IEventEmitter
<
number
>
;
_onKey
:
IEventEmitter
<
{
key
:
string
}
>
;
_charSizeService
:
{
width
:
number
;
height
:
number
;
};
_coreService
:
{
triggerDataEvent
(
data
:
string
,
wasUserInput
?:
boolean
):
void
;
}
_renderService
:
{
...
...
src/vs/platform/driver/electron-browser/driver.ts
浏览文件 @
6a358f77
...
...
@@ -206,7 +206,7 @@ class WindowDriver implements IWindowDriver {
throw
new
Error
(
`Xterm not found:
${
selector
}
`
);
}
xterm
.
_core
.
handler
(
text
);
xterm
.
_core
.
_coreService
.
triggerDataEvent
(
text
);
}
async
openDevTools
():
Promise
<
void
>
{
...
...
src/vs/workbench/contrib/terminal/browser/terminalInstance.ts
浏览文件 @
6a358f77
...
...
@@ -1420,8 +1420,7 @@ export class TerminalInstance implements ITerminalInstance {
}
public
toggleEscapeSequenceLogging
():
void
{
this
.
_xterm
.
_core
.
debug
=
!
this
.
_xterm
.
_core
.
debug
;
this
.
_xterm
.
setOption
(
'
debug
'
,
this
.
_xterm
.
_core
.
debug
);
this
.
_xterm
.
setOption
(
'
logLevel
'
,
'
debug
'
);
}
public
getInitialCwd
():
Promise
<
string
>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录