Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
aeaec811
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,发现更多精彩内容 >>
提交
aeaec811
编写于
11月 29, 2016
作者:
K
Kai Wood
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Refactor terminals configuration concerns
上级
529a0cda
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
24 deletion
+10
-24
src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts
...bench/parts/terminal/electron-browser/terminalInstance.ts
+6
-2
src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts
...orkbench/parts/terminal/electron-browser/terminalPanel.ts
+0
-3
src/vs/workbench/parts/terminal/electron-browser/terminalService.ts
...kbench/parts/terminal/electron-browser/terminalService.ts
+4
-19
未找到文件。
src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts
浏览文件 @
aeaec811
...
@@ -18,7 +18,7 @@ import { IContextKey } from 'vs/platform/contextkey/common/contextkey';
...
@@ -18,7 +18,7 @@ import { IContextKey } from 'vs/platform/contextkey/common/contextkey';
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
IMessageService
,
Severity
}
from
'
vs/platform/message/common/message
'
;
import
{
IMessageService
,
Severity
}
from
'
vs/platform/message/common/message
'
;
import
{
IStringDictionary
}
from
'
vs/base/common/collections
'
;
import
{
IStringDictionary
}
from
'
vs/base/common/collections
'
;
import
{
ITerminalInstance
,
IShell
}
from
'
vs/workbench/parts/terminal/common/terminal
'
;
import
{
ITerminal
Service
,
ITerminal
Instance
,
IShell
}
from
'
vs/workbench/parts/terminal/common/terminal
'
;
import
{
IWorkspace
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IWorkspace
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
Keybinding
}
from
'
vs/base/common/keybinding
'
;
import
{
Keybinding
}
from
'
vs/base/common/keybinding
'
;
import
{
StandardKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
StandardKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
...
@@ -65,7 +65,8 @@ export class TerminalInstance implements ITerminalInstance {
...
@@ -65,7 +65,8 @@ export class TerminalInstance implements ITerminalInstance {
name
:
string
,
name
:
string
,
shell
:
IShell
,
shell
:
IShell
,
@
IKeybindingService
private
_keybindingService
:
IKeybindingService
,
@
IKeybindingService
private
_keybindingService
:
IKeybindingService
,
@
IMessageService
private
_messageService
:
IMessageService
@
IMessageService
private
_messageService
:
IMessageService
,
@
ITerminalService
private
_terminalService
:
ITerminalService
)
{
)
{
this
.
_toDispose
=
[];
this
.
_toDispose
=
[];
this
.
_skipTerminalKeybindings
=
[];
this
.
_skipTerminalKeybindings
=
[];
...
@@ -168,6 +169,9 @@ export class TerminalInstance implements ITerminalInstance {
...
@@ -168,6 +169,9 @@ export class TerminalInstance implements ITerminalInstance {
const
height
=
parseInt
(
computedStyle
.
getPropertyValue
(
'
height
'
).
replace
(
'
px
'
,
''
),
10
);
const
height
=
parseInt
(
computedStyle
.
getPropertyValue
(
'
height
'
).
replace
(
'
px
'
,
''
),
10
);
this
.
layout
(
new
Dimension
(
width
,
height
));
this
.
layout
(
new
Dimension
(
width
,
height
));
this
.
setVisible
(
this
.
_isVisible
);
this
.
setVisible
(
this
.
_isVisible
);
this
.
setCursorBlink
(
this
.
_terminalService
.
configHelper
.
getCursorBlink
());
this
.
setCommandsToSkipShell
(
this
.
_terminalService
.
configHelper
.
getCommandsToSkipShell
());
this
.
setScrollback
(
this
.
_terminalService
.
configHelper
.
getScrollback
());
}
}
public
copySelection
():
void
{
public
copySelection
():
void
{
...
...
src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts
浏览文件 @
aeaec811
...
@@ -66,7 +66,6 @@ export class TerminalPanel extends Panel {
...
@@ -66,7 +66,6 @@ export class TerminalPanel extends Panel {
this
.
_register
(
this
.
_configurationService
.
onDidUpdateConfiguration
(
this
.
_updateFont
.
bind
(
this
)));
this
.
_register
(
this
.
_configurationService
.
onDidUpdateConfiguration
(
this
.
_updateFont
.
bind
(
this
)));
this
.
_updateFont
();
this
.
_updateFont
();
this
.
_updateTheme
();
this
.
_updateTheme
();
this
.
_terminalService
.
updateConfig
();
// Force another layout (first is setContainers) since config has changed
// Force another layout (first is setContainers) since config has changed
this
.
layout
(
new
Dimension
(
this
.
_terminalContainer
.
offsetWidth
,
this
.
_terminalContainer
.
offsetHeight
));
this
.
layout
(
new
Dimension
(
this
.
_terminalContainer
.
offsetWidth
,
this
.
_terminalContainer
.
offsetHeight
));
...
@@ -85,13 +84,11 @@ export class TerminalPanel extends Panel {
...
@@ -85,13 +84,11 @@ export class TerminalPanel extends Panel {
public
setVisible
(
visible
:
boolean
):
TPromise
<
void
>
{
public
setVisible
(
visible
:
boolean
):
TPromise
<
void
>
{
if
(
visible
)
{
if
(
visible
)
{
if
(
this
.
_terminalService
.
terminalInstances
.
length
>
0
)
{
if
(
this
.
_terminalService
.
terminalInstances
.
length
>
0
)
{
this
.
_terminalService
.
updateConfig
();
this
.
_updateFont
();
this
.
_updateFont
();
this
.
_updateTheme
();
this
.
_updateTheme
();
}
else
{
}
else
{
return
super
.
setVisible
(
visible
).
then
(()
=>
{
return
super
.
setVisible
(
visible
).
then
(()
=>
{
this
.
_terminalService
.
createInstance
();
this
.
_terminalService
.
createInstance
();
this
.
_terminalService
.
updateConfig
();
this
.
_updateFont
();
this
.
_updateFont
();
this
.
_updateTheme
();
this
.
_updateTheme
();
});
});
...
...
src/vs/workbench/parts/terminal/electron-browser/terminalService.ts
浏览文件 @
aeaec811
...
@@ -83,9 +83,6 @@ export class TerminalService implements ITerminalService {
...
@@ -83,9 +83,6 @@ export class TerminalService implements ITerminalService {
this
.
setActiveInstanceByIndex
(
0
);
this
.
setActiveInstanceByIndex
(
0
);
}
}
this
.
_onInstancesChanged
.
fire
();
this
.
_onInstancesChanged
.
fire
();
this
.
_updateCursorBlink
(
terminalInstance
);
this
.
_updateCommandsToSkipShell
(
terminalInstance
);
this
.
_updateScrollback
(
terminalInstance
);
return
terminalInstance
;
return
terminalInstance
;
}
}
...
@@ -208,22 +205,10 @@ export class TerminalService implements ITerminalService {
...
@@ -208,22 +205,10 @@ export class TerminalService implements ITerminalService {
}
}
public
updateConfig
():
void
{
public
updateConfig
():
void
{
this
.
terminalInstances
.
forEach
((
i
nstance
)
=>
{
this
.
terminalInstances
.
forEach
((
terminalI
nstance
)
=>
{
t
his
.
_updateCursorBlink
(
instance
);
t
erminalInstance
.
setCursorBlink
(
this
.
configHelper
.
getCursorBlink
()
);
t
his
.
_updateCommandsToSkipShell
(
instance
);
t
erminalInstance
.
setCommandsToSkipShell
(
this
.
configHelper
.
getCommandsToSkipShell
()
);
t
his
.
_updateScrollback
(
instance
);
t
erminalInstance
.
setScrollback
(
this
.
configHelper
.
getScrollback
()
);
});
});
}
}
private
_updateCursorBlink
(
terminalInstance
):
void
{
terminalInstance
.
setCursorBlink
(
this
.
configHelper
.
getCursorBlink
());
}
private
_updateCommandsToSkipShell
(
terminalInstance
):
void
{
terminalInstance
.
setCommandsToSkipShell
(
this
.
configHelper
.
getCommandsToSkipShell
());
}
private
_updateScrollback
(
terminalInstance
):
void
{
terminalInstance
.
setScrollback
(
this
.
configHelper
.
getScrollback
());
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录