Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
ced74049
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,发现更多精彩内容 >>
未验证
提交
ced74049
编写于
10月 28, 2020
作者:
C
Connor Peet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
terminal: make typeahead style more friendly
Fixes
https://github.com/microsoft/vscode/issues/109590
上级
dff9be8c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
21 addition
and
20 deletion
+21
-20
src/vs/workbench/contrib/terminal/browser/terminalTypeAheadAddon.ts
...kbench/contrib/terminal/browser/terminalTypeAheadAddon.ts
+16
-7
src/vs/workbench/contrib/terminal/common/terminal.ts
src/vs/workbench/contrib/terminal/common/terminal.ts
+1
-1
src/vs/workbench/contrib/terminal/common/terminalConfiguration.ts
...orkbench/contrib/terminal/common/terminalConfiguration.ts
+4
-12
未找到文件。
src/vs/workbench/contrib/terminal/browser/terminalTypeAheadAddon.ts
浏览文件 @
ced74049
...
...
@@ -9,7 +9,7 @@ import { Emitter } from 'vs/base/common/event';
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
TerminalConfigHelper
}
from
'
vs/workbench/contrib/terminal/browser/terminalConfigHelper
'
;
import
{
IBeforeProcessDataEvent
,
ITerminalProcessManager
}
from
'
vs/workbench/contrib/terminal/common/terminal
'
;
import
{
IBeforeProcessDataEvent
,
ITerminal
Configuration
,
ITerminal
ProcessManager
}
from
'
vs/workbench/contrib/terminal/common/terminal
'
;
import
type
{
IBuffer
,
IBufferCell
,
ITerminalAddon
,
Terminal
}
from
'
xterm
'
;
const
ESC
=
'
\
x1b
'
;
...
...
@@ -849,13 +849,22 @@ const getBufferCellAttributes = (cell: IBufferCell) => cell.isAttributeDefault()
cell
.
isBgDefault
()
&&
`
${
CSI
}
49m`
,
].
filter
(
seq
=>
!!
seq
).
join
(
''
);
const
parseTypeheadStyle
=
(
style
:
string
|
number
)
=>
{
if
(
typeof
style
===
'
number
'
)
{
return
`
${
CSI
}${
style
}
m`
;
const
parseTypeheadStyle
=
(
style
:
ITerminalConfiguration
[
'
typeaheadStyle
'
])
=>
{
switch
(
style
)
{
case
'
bold
'
:
return
`
${
CSI
}
1m`
;
case
'
dim
'
:
return
`
${
CSI
}
2m`
;
case
'
italic
'
:
return
`
${
CSI
}
3m`
;
case
'
underlined
'
:
return
`
${
CSI
}
4m`
;
case
'
inverted
'
:
return
`
${
CSI
}
7m`
;
default
:
const
{
r
,
g
,
b
}
=
Color
.
fromHex
(
style
).
rgba
;
return
`
${
CSI
}
38;2;
${
r
}
;
${
g
}
;
${
b
}
m`
;
}
const
{
r
,
g
,
b
}
=
Color
.
fromHex
(
style
).
rgba
;
return
`
${
CSI
}
38;2;
${
r
}
;
${
g
}
;
${
b
}
m`
;
};
export
class
TypeAheadAddon
extends
Disposable
implements
ITerminalAddon
{
...
...
src/vs/workbench/contrib/terminal/common/terminal.ts
浏览文件 @
ced74049
...
...
@@ -136,7 +136,7 @@ export interface ITerminalConfiguration {
unicodeVersion
:
'
6
'
|
'
11
'
;
experimentalLinkProvider
:
boolean
;
typeaheadThreshold
:
number
;
typeaheadStyle
:
number
|
string
;
typeaheadStyle
:
'
bold
'
|
'
dim
'
|
'
italic
'
|
'
underlined
'
|
'
inverted
'
|
string
;
serverSpawn
:
boolean
;
enablePersistentSessions
:
boolean
;
}
...
...
src/vs/workbench/contrib/terminal/common/terminalConfiguration.ts
浏览文件 @
ced74049
...
...
@@ -360,20 +360,12 @@ export const terminalConfiguration: IConfigurationNode = {
},
'
terminal.integrated.typeaheadStyle
'
:
{
description
:
localize
(
'
terminal.integrated.typeaheadStyle
'
,
"
Experimental: terminal style of typeahead text, either a font style or an RGB color.
"
),
default
:
2
,
default
:
'
dim
'
,
oneOf
:
[
{
type
:
'
integer
'
,
default
:
2
,
enum
:
[
0
,
1
,
2
,
3
,
4
,
7
],
enumDescriptions
:
[
localize
(
'
terminal.integrated.typeaheadStyle.0
'
,
'
Normal
'
),
localize
(
'
terminal.integrated.typeaheadStyle.1
'
,
'
Bold
'
),
localize
(
'
terminal.integrated.typeaheadStyle.2
'
,
'
Dim
'
),
localize
(
'
terminal.integrated.typeaheadStyle.3
'
,
'
Italic
'
),
localize
(
'
terminal.integrated.typeaheadStyle.4
'
,
'
Underlined
'
),
localize
(
'
terminal.integrated.typeaheadStyle.7
'
,
'
Inverted
'
),
]
type
:
'
string
'
,
default
:
'
dim
'
,
enum
:
[
'
bold
'
,
'
dim
'
,
'
italic
'
,
'
underlined
'
,
'
inverted
'
],
},
{
type
:
'
string
'
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录