Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
316d6f83
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,发现更多精彩内容 >>
提交
316d6f83
编写于
3月 12, 2017
作者:
P
Phawin Khongkhasawan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Provide "terminal.integrated.enableBold" setting connected to #22422
上级
7ecdd35f
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
36 addition
and
2 deletion
+36
-2
src/vs/workbench/parts/execution/electron-browser/terminal.contribution.ts
...parts/execution/electron-browser/terminal.contribution.ts
+1
-1
src/vs/workbench/parts/terminal/common/terminal.ts
src/vs/workbench/parts/terminal/common/terminal.ts
+2
-0
src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.ts
.../parts/terminal/electron-browser/terminal.contribution.ts
+5
-0
src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts
...h/parts/terminal/electron-browser/terminalConfigHelper.ts
+6
-1
src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts
...orkbench/parts/terminal/electron-browser/terminalPanel.ts
+1
-0
src/vs/workbench/parts/terminal/test/electron-browser/terminalConfigHelper.test.ts
...rminal/test/electron-browser/terminalConfigHelper.test.ts
+21
-0
未找到文件。
src/vs/workbench/parts/execution/electron-browser/terminal.contribution.ts
浏览文件 @
316d6f83
...
...
@@ -50,7 +50,7 @@ DEFAULT_TERMINAL_LINUX_READY.then(defaultTerminalLinux => {
'
description
'
:
nls
.
localize
(
'
terminal.external.linuxExec
'
,
"
Customizes which terminal to run on Linux.
"
),
'
default
'
:
defaultTerminalLinux
,
'
isExecutable
'
:
true
}
}
,
}
});
});
...
...
src/vs/workbench/parts/terminal/common/terminal.ts
浏览文件 @
316d6f83
...
...
@@ -52,6 +52,7 @@ export interface ITerminalConfiguration {
fontFamily
:
string
;
fontLigatures
:
boolean
;
fontSize
:
number
;
fontWeight
:
string
;
lineHeight
:
number
;
setLocaleVariables
:
boolean
;
scrollback
:
number
;
...
...
@@ -71,6 +72,7 @@ export interface ITerminalFont {
lineHeight
:
number
;
charWidth
:
number
;
charHeight
:
number
;
fontWeight
:
string
;
}
export
interface
IShellLaunchConfig
{
...
...
src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.ts
浏览文件 @
316d6f83
...
...
@@ -106,6 +106,11 @@ configurationRegistry.registerConfiguration({
'
type
'
:
'
number
'
,
'
default
'
:
1.2
},
'
terminal.integrated.fontWeight
'
:
{
'
type
'
:
'
string
'
,
'
description
'
:
nls
.
localize
(
'
terminal.integrated.fontWeight
'
,
"
Customizes font weight in terminal.
"
),
'
default
'
:
'
normal
'
},
'
terminal.integrated.cursorBlinking
'
:
{
'
description
'
:
nls
.
localize
(
'
terminal.integrated.cursorBlinking
'
,
"
Controls whether the terminal cursor blinks.
"
),
'
type
'
:
'
boolean
'
,
...
...
src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts
浏览文件 @
316d6f83
...
...
@@ -35,6 +35,10 @@ export class TerminalConfigHelper implements ITerminalConfigHelper {
return
this
.
_configurationService
.
getConfiguration
<
IFullTerminalConfiguration
>
().
terminal
.
integrated
;
}
public
getTheme
(
baseThemeId
:
string
):
string
[]
{
return
DEFAULT_ANSI_COLORS
[
baseThemeId
];
}
private
_measureFont
(
fontFamily
:
string
,
fontSize
:
number
,
lineHeight
:
number
):
ITerminalFont
{
// Create charMeasureElement if it hasn't been created or if it was orphaned by its parent
if
(
!
this
.
_charMeasureElement
||
!
this
.
_charMeasureElement
.
parentElement
)
{
...
...
@@ -79,12 +83,13 @@ export class TerminalConfigHelper implements ITerminalConfigHelper {
if
(
fontSize
<=
0
)
{
fontSize
=
DefaultConfig
.
editor
.
fontSize
;
}
let
fontWeight
=
terminalConfig
.
fontWeight
;
let
lineHeight
=
terminalConfig
.
lineHeight
<=
0
?
DEFAULT_LINE_HEIGHT
:
terminalConfig
.
lineHeight
;
if
(
!
lineHeight
)
{
lineHeight
=
DEFAULT_LINE_HEIGHT
;
}
return
this
.
_measureFont
(
fontFamily
,
fontSize
,
lineHeight
);
return
this
.
_measureFont
(
fontFamily
,
fontSize
,
lineHeight
,
fontWeight
);
}
public
mergeDefaultShellPathAndArgs
(
shell
:
IShellLaunchConfig
):
IShellLaunchConfig
{
...
...
src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts
浏览文件 @
316d6f83
...
...
@@ -235,6 +235,7 @@ export class TerminalPanel extends Panel {
`font-family:
${
newFont
.
fontFamily
}
;`
+
`font-size:
${
newFont
.
fontSize
}
;`
+
`line-height:
${
newFont
.
lineHeight
}
;`
+
`font-weight:
${
newFont
.
fontWeight
}
;`
+
'
}
'
;
this
.
_font
=
newFont
;
}
...
...
src/vs/workbench/parts/terminal/test/electron-browser/terminalConfigHelper.test.ts
浏览文件 @
316d6f83
...
...
@@ -117,6 +117,27 @@ suite('Workbench - TerminalConfigHelper', () => {
assert
.
equal
(
configHelper
.
getFont
().
fontSize
,
`
${
DefaultConfig
.
editor
.
fontSize
}
px`
,
'
The default editor font size should be used when editor.fontSize is < 0 and terminal.integrated.fontSize not set
'
);
});
test
(
'
TerminalConfigHelper - getFont fontWeight
'
,
function
()
{
let
configurationService
:
IConfigurationService
;
let
configHelper
:
TerminalConfigHelper
;
configurationService
=
new
MockConfigurationService
({
editor
:
{
fontFamily
:
'
foo
'
,
fontWeight
:
'
normal
'
},
terminal
:
{
integrated
:
{
fontFamily
:
'
bar
'
,
fontWeight
:
'
bold
'
}
}
});
configHelper
=
new
TerminalConfigHelper
(
Platform
.
Linux
,
configurationService
);
configHelper
.
panelContainer
=
fixture
;
assert
.
equal
(
configHelper
.
getFont
().
fontWeight
,
'
bold
'
,
'
terminal.integrated.fontWeight should be selected over editor.fontWeight
'
);
});
test
(
'
TerminalConfigHelper - getFont lineHeight
'
,
function
()
{
let
configurationService
:
IConfigurationService
;
let
configHelper
:
TerminalConfigHelper
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录