Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
f26b1d08
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,发现更多精彩内容 >>
提交
f26b1d08
编写于
9月 09, 2016
作者:
D
Daniel Imms
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix instance visibility on launch
上级
be8f35a8
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
25 addition
and
14 deletion
+25
-14
src/vs/workbench/parts/terminal/electron-browser/terminal.ts
src/vs/workbench/parts/terminal/electron-browser/terminal.ts
+2
-1
src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts
...orkbench/parts/terminal/electron-browser/terminalPanel.ts
+14
-7
src/vs/workbench/parts/terminal/electron-browser/terminalService.ts
...kbench/parts/terminal/electron-browser/terminalService.ts
+9
-6
未找到文件。
src/vs/workbench/parts/terminal/electron-browser/terminal.ts
浏览文件 @
f26b1d08
...
...
@@ -12,7 +12,7 @@ import {Builder, Dimension} from 'vs/base/browser/builder';
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
RawContextKey
,
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
ITerminalFont
}
from
'
vs/workbench/parts/terminal/electron-browser/terminalConfigHelper
'
;
import
{
TerminalConfigHelper
,
ITerminalFont
}
from
'
vs/workbench/parts/terminal/electron-browser/terminalConfigHelper
'
;
export
const
TERMINAL_PANEL_ID
=
'
workbench.panel.terminal
'
;
...
...
@@ -100,6 +100,7 @@ export interface ITerminalService {
onInstanceTitleChanged
:
Event
<
string
>
;
activeTerminalInstanceIndex
:
number
;
configHelper
:
TerminalConfigHelper
;
terminalInstances
:
ITerminalInstance
[];
createInstance
(
name
?:
string
):
ITerminalInstance
;
...
...
src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts
浏览文件 @
f26b1d08
...
...
@@ -10,6 +10,7 @@ import nls = require('vs/nls');
import
{
Action
,
IAction
}
from
'
vs/base/common/actions
'
;
import
{
Builder
,
Dimension
}
from
'
vs/base/browser/builder
'
;
import
{
IActionItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
...
...
@@ -20,7 +21,7 @@ import {KillTerminalAction, CreateNewTerminalAction, SwitchTerminalInstanceActio
import
{
Panel
}
from
'
vs/workbench/browser/panel
'
;
import
{
Separator
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
StandardMouseEvent
}
from
'
vs/base/browser/mouseEvent
'
;
import
{
TerminalConfigHelper
,
ITerminalFont
}
from
'
vs/workbench/parts/terminal/electron-browser/terminalConfigHelper
'
;
import
{
ITerminalFont
}
from
'
vs/workbench/parts/terminal/electron-browser/terminalConfigHelper
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
getBaseThemeId
}
from
'
vs/platform/theme/common/themes
'
;
...
...
@@ -38,7 +39,7 @@ export class TerminalPanel extends Panel implements ITerminalPanel {
private
font
:
ITerminalFont
;
constructor
(
private
configHelper
:
TerminalConfigHelper
,
@
IConfigurationService
private
configurationService
:
IConfigurationService
,
@
IContextMenuService
private
contextMenuService
:
IContextMenuService
,
@
IInstantiationService
private
instantiationService
:
IInstantiationService
,
@
IKeybindingService
private
keybindingService
:
IKeybindingService
,
...
...
@@ -65,6 +66,12 @@ export class TerminalPanel extends Panel implements ITerminalPanel {
this
.
attachEventListeners
();
this
.
terminalService
.
setContainers
(
this
.
getContainer
(),
this
.
terminalContainer
);
this
.
toDispose
.
push
(
this
.
themeService
.
onDidColorThemeChange
(
this
.
updateTheme
.
bind
(
this
)));
this
.
toDispose
.
push
(
this
.
configurationService
.
onDidUpdateConfiguration
(
this
.
updateConfig
.
bind
(
this
)));
this
.
updateTheme
();
this
.
updateConfig
();
return
TPromise
.
as
(
void
0
);
}
...
...
@@ -188,7 +195,7 @@ export class TerminalPanel extends Panel implements ITerminalPanel {
}
this
.
currentBaseThemeId
=
baseThemeId
;
let
theme
=
this
.
configHelper
.
getTheme
(
baseThemeId
);
let
theme
=
this
.
terminalService
.
configHelper
.
getTheme
(
baseThemeId
);
let
css
=
''
;
theme
.
forEach
((
color
:
string
,
index
:
number
)
=>
{
...
...
@@ -222,8 +229,8 @@ export class TerminalPanel extends Panel implements ITerminalPanel {
if
(
this
.
terminalService
.
terminalInstances
.
length
===
0
)
{
return
;
}
let
newFont
=
this
.
configHelper
.
getFont
();
DOM
.
toggleClass
(
this
.
parentDomElement
,
'
enable-ligatures
'
,
this
.
configHelper
.
getFontLigaturesEnabled
());
let
newFont
=
this
.
terminalService
.
configHelper
.
getFont
();
DOM
.
toggleClass
(
this
.
parentDomElement
,
'
enable-ligatures
'
,
this
.
terminalService
.
configHelper
.
getFontLigaturesEnabled
());
if
(
!
this
.
font
||
this
.
fontsDiffer
(
this
.
font
,
newFont
))
{
this
.
fontStyleElement
.
innerHTML
=
'
.monaco-workbench .panel.integrated-terminal .xterm {
'
+
`font-family:
${
newFont
.
fontFamily
}
;`
+
...
...
@@ -246,13 +253,13 @@ export class TerminalPanel extends Panel implements ITerminalPanel {
private
updateCursorBlink
():
void
{
this
.
terminalService
.
terminalInstances
.
forEach
((
instance
)
=>
{
instance
.
setCursorBlink
(
this
.
configHelper
.
getCursorBlink
());
instance
.
setCursorBlink
(
this
.
terminalService
.
configHelper
.
getCursorBlink
());
});
}
private
updateCommandsToSkipShell
():
void
{
this
.
terminalService
.
terminalInstances
.
forEach
((
instance
)
=>
{
instance
.
setCommandsToSkipShell
(
this
.
configHelper
.
getCommandsToSkipShell
());
instance
.
setCommandsToSkipShell
(
this
.
terminalService
.
configHelper
.
getCommandsToSkipShell
());
});
}
}
...
...
src/vs/workbench/parts/terminal/electron-browser/terminalService.ts
浏览文件 @
f26b1d08
...
...
@@ -20,8 +20,10 @@ export class TerminalService implements ITerminalService {
public
_serviceBrand
:
any
;
private
_activeTerminalInstanceIndex
:
number
=
0
;
private
_configHelper
:
TerminalConfigHelper
;
private
_terminalInstances
:
ITerminalInstance
[]
=
[];
public
get
activeTerminalInstanceIndex
():
number
{
return
this
.
_activeTerminalInstanceIndex
;
}
public
get
configHelper
():
TerminalConfigHelper
{
return
this
.
_configHelper
;
}
public
get
terminalInstances
():
ITerminalInstance
[]
{
return
this
.
_terminalInstances
;
}
private
_onActiveInstanceChanged
:
Emitter
<
string
>
;
...
...
@@ -32,7 +34,6 @@ export class TerminalService implements ITerminalService {
public
get
onInstanceTitleChanged
():
Event
<
string
>
{
return
this
.
_onInstanceTitleChanged
.
event
;
}
private
terminalContainer
:
HTMLElement
;
private
configHelper
:
TerminalConfigHelper
;
private
terminalFocusContextKey
:
IContextKey
<
boolean
>
;
constructor
(
...
...
@@ -46,15 +47,17 @@ export class TerminalService implements ITerminalService {
this
.
_onInstancesChanged
=
new
Emitter
<
string
>
();
this
.
_onInstanceTitleChanged
=
new
Emitter
<
string
>
();
this
.
terminalFocusContextKey
=
KEYBINDING_CONTEXT_TERMINAL_FOCUS
.
bindTo
(
this
.
contextKeyService
);
this
.
configHelper
=
<
TerminalConfigHelper
>
this
.
instantiationService
.
createInstance
(
TerminalConfigHelper
,
platform
.
platform
);
this
.
_
configHelper
=
<
TerminalConfigHelper
>
this
.
instantiationService
.
createInstance
(
TerminalConfigHelper
,
platform
.
platform
);
}
public
createInstance
():
ITerminalInstance
{
console
.
log
(
'
creating instance
'
);
console
.
log
(
'
config helper
'
,
this
.
configHelper
);
let
terminalInstance
=
<
TerminalInstance
>
this
.
instantiationService
.
createInstance
(
TerminalInstance
,
this
.
terminalFocusContextKey
,
this
.
onTerminalInstanceDispose
.
bind
(
this
),
this
.
configHelper
,
this
.
terminalContainer
);
this
.
terminalFocusContextKey
,
this
.
onTerminalInstanceDispose
.
bind
(
this
),
this
.
_
configHelper
,
this
.
terminalContainer
);
this
.
terminalInstances
.
push
(
terminalInstance
);
if
(
this
.
terminalInstances
.
length
===
1
)
{
// It's the first instance so it should be focused
this
.
setActiveInstanceByIndex
(
0
);
}
this
.
_onInstancesChanged
.
fire
();
return
terminalInstance
;
}
...
...
@@ -116,7 +119,7 @@ export class TerminalService implements ITerminalService {
this
.
_terminalInstances
.
forEach
(
terminalInstance
=>
{
terminalInstance
.
attachToElement
(
this
.
terminalContainer
);
});
this
.
configHelper
.
panelContainer
=
panelContainer
;
this
.
_
configHelper
.
panelContainer
=
panelContainer
;
}
public
showPanel
(
focus
?:
boolean
):
TPromise
<
void
>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录