Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
2880c92f
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,发现更多精彩内容 >>
提交
2880c92f
编写于
5月 25, 2016
作者:
D
Daniel Imms
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add default terminal colors per theme, update immediately on theme change
Part of #6766
上级
a2d4a292
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
71 addition
and
1 deletion
+71
-1
src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts
...orkbench/parts/terminal/electron-browser/terminalPanel.ts
+71
-1
未找到文件。
src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts
浏览文件 @
2880c92f
...
...
@@ -11,11 +11,13 @@ import path = require('path');
import
URI
from
'
vs/base/common/uri
'
;
import
DOM
=
require
(
'
vs/base/browser/dom
'
);
import
platform
=
require
(
'
vs/base/common/platform
'
);
import
{
getBaseThemeId
}
from
'
vs/platform/theme/common/themes
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
Builder
,
Dimension
}
from
'
vs/base/browser/builder
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IStringDictionary
}
from
'
vs/base/common/collections
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IThemeService
}
from
'
vs/workbench/services/themes/common/themeService
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
ITerminalConfiguration
,
ITerminalService
,
TERMINAL_PANEL_ID
}
from
'
vs/workbench/parts/terminal/common/terminal
'
;
import
{
Panel
}
from
'
vs/workbench/browser/panel
'
;
...
...
@@ -25,6 +27,63 @@ import {ScrollbarVisibility} from 'vs/base/browser/ui/scrollbar/scrollableElemen
const
TERMINAL_CHAR_WIDTH
=
8
;
const
TERMINAL_CHAR_HEIGHT
=
18
;
const
DEFAULT_ANSI_COLORS
=
{
'
hc-black
'
:
[
'
#000000
'
,
// black
'
#cd0000
'
,
// red
'
#00cd00
'
,
// green
'
#cdcd00
'
,
// yellow
'
#0000ee
'
,
// blue
'
#cd00cd
'
,
// magenta
'
#00cdcd
'
,
// cyan
'
#e5e5e5
'
,
// white
'
#7f7f7f
'
,
// bright black
'
#ff0000
'
,
// bright red
'
#00ff00
'
,
// bright green
'
#ffff00
'
,
// bright yellow
'
#5c5cff
'
,
// bright blue
'
#ff00ff
'
,
// bright magenta
'
#00ffff
'
,
// bright cyan
'
#ffffff
'
// bright white
],
'
vs
'
:
[
'
#000000
'
,
// black
'
#cd3131
'
,
// red
'
#09885a
'
,
// green
'
#e5e510
'
,
// yellow
'
#0451a5
'
,
// blue
'
#bc05bc
'
,
// magenta
'
#0598bc
'
,
// cyan
'
#e5e5e5
'
,
// white
'
#111111
'
,
// bright black
'
#cd3131
'
,
// bright red
'
#09885a
'
,
// bright green
'
#e5e510
'
,
// bright yellow
'
#0451a5
'
,
// bright blue
'
#bc05bc
'
,
// bright magenta
'
#0598bc
'
,
// bright cyan
'
#e5e5e5
'
// bright white
],
'
vs-dark
'
:
[
'
#000000
'
,
// black
'
#cd3131
'
,
// red
'
#09885a
'
,
// green
'
#e5e510
'
,
// yellow
'
#0451a5
'
,
// blue
'
#bc05bc
'
,
// magenta
'
#0598bc
'
,
// cyan
'
#e5e5e5
'
,
// white
'
#111111
'
,
// bright black
'
#cd3131
'
,
// bright red
'
#09885a
'
,
// bright green
'
#e5e510
'
,
// bright yellow
'
#0451a5
'
,
// bright blue
'
#bc05bc
'
,
// bright magenta
'
#0598bc
'
,
// bright cyan
'
#e5e5e5
'
// bright white
]
};
export
class
TerminalPanel
extends
Panel
{
private
toDispose
:
lifecycle
.
IDisposable
[];
...
...
@@ -37,7 +96,8 @@ export class TerminalPanel extends Panel {
@
IConfigurationService
private
configurationService
:
IConfigurationService
,
@
ITelemetryService
telemetryService
:
ITelemetryService
,
@
IWorkspaceContextService
private
contextService
:
IWorkspaceContextService
,
@
ITerminalService
private
terminalService
:
ITerminalService
@
ITerminalService
private
terminalService
:
ITerminalService
,
@
IThemeService
private
themeService
:
IThemeService
)
{
super
(
TERMINAL_PANEL_ID
,
telemetryService
);
this
.
toDispose
=
[];
...
...
@@ -132,16 +192,26 @@ export class TerminalPanel extends Panel {
this
.
focusTerminal
();
}
}));
this
.
toDispose
.
push
(
this
.
themeService
.
onDidThemeChange
((
themeId
)
=>
{
this
.
setTerminalTheme
(
themeId
);
}));
this
.
terminal
.
open
(
this
.
terminalDomElement
);
this
.
parentDomElement
.
appendChild
(
terminalScrollbar
.
getDomNode
());
let
config
=
this
.
configurationService
.
getConfiguration
<
ITerminalConfiguration
>
();
this
.
terminalDomElement
.
style
.
fontFamily
=
config
.
integratedTerminal
.
fontFamily
;
this
.
setTerminalTheme
(
this
.
themeService
.
getTheme
());
resolve
(
void
0
);
});
}
private
setTerminalTheme
(
themeId
:
string
)
{
let
baseThemeId
=
getBaseThemeId
(
themeId
);
this
.
terminal
.
colors
=
DEFAULT_ANSI_COLORS
[
baseThemeId
];
this
.
terminal
.
refresh
(
0
,
this
.
terminal
.
rows
);
}
public
focus
():
void
{
this
.
focusTerminal
(
true
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录