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';
...
@@ -12,7 +12,7 @@ import {Builder, Dimension} from 'vs/base/browser/builder';
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
RawContextKey
,
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
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
'
;
export
const
TERMINAL_PANEL_ID
=
'
workbench.panel.terminal
'
;
...
@@ -100,6 +100,7 @@ export interface ITerminalService {
...
@@ -100,6 +100,7 @@ export interface ITerminalService {
onInstanceTitleChanged
:
Event
<
string
>
;
onInstanceTitleChanged
:
Event
<
string
>
;
activeTerminalInstanceIndex
:
number
;
activeTerminalInstanceIndex
:
number
;
configHelper
:
TerminalConfigHelper
;
terminalInstances
:
ITerminalInstance
[];
terminalInstances
:
ITerminalInstance
[];
createInstance
(
name
?:
string
):
ITerminalInstance
;
createInstance
(
name
?:
string
):
ITerminalInstance
;
...
...
src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts
浏览文件 @
f26b1d08
...
@@ -10,6 +10,7 @@ import nls = require('vs/nls');
...
@@ -10,6 +10,7 @@ import nls = require('vs/nls');
import
{
Action
,
IAction
}
from
'
vs/base/common/actions
'
;
import
{
Action
,
IAction
}
from
'
vs/base/common/actions
'
;
import
{
Builder
,
Dimension
}
from
'
vs/base/browser/builder
'
;
import
{
Builder
,
Dimension
}
from
'
vs/base/browser/builder
'
;
import
{
IActionItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
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
{
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
...
@@ -20,7 +21,7 @@ import {KillTerminalAction, CreateNewTerminalAction, SwitchTerminalInstanceActio
...
@@ -20,7 +21,7 @@ import {KillTerminalAction, CreateNewTerminalAction, SwitchTerminalInstanceActio
import
{
Panel
}
from
'
vs/workbench/browser/panel
'
;
import
{
Panel
}
from
'
vs/workbench/browser/panel
'
;
import
{
Separator
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
Separator
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
StandardMouseEvent
}
from
'
vs/base/browser/mouseEvent
'
;
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
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
getBaseThemeId
}
from
'
vs/platform/theme/common/themes
'
;
import
{
getBaseThemeId
}
from
'
vs/platform/theme/common/themes
'
;
...
@@ -38,7 +39,7 @@ export class TerminalPanel extends Panel implements ITerminalPanel {
...
@@ -38,7 +39,7 @@ export class TerminalPanel extends Panel implements ITerminalPanel {
private
font
:
ITerminalFont
;
private
font
:
ITerminalFont
;
constructor
(
constructor
(
private
configHelper
:
TerminalConfigHelper
,
@
IConfigurationService
private
configurationService
:
IConfigurationService
,
@
IContextMenuService
private
contextMenuService
:
IContextMenuService
,
@
IContextMenuService
private
contextMenuService
:
IContextMenuService
,
@
IInstantiationService
private
instantiationService
:
IInstantiationService
,
@
IInstantiationService
private
instantiationService
:
IInstantiationService
,
@
IKeybindingService
private
keybindingService
:
IKeybindingService
,
@
IKeybindingService
private
keybindingService
:
IKeybindingService
,
...
@@ -65,6 +66,12 @@ export class TerminalPanel extends Panel implements ITerminalPanel {
...
@@ -65,6 +66,12 @@ export class TerminalPanel extends Panel implements ITerminalPanel {
this
.
attachEventListeners
();
this
.
attachEventListeners
();
this
.
terminalService
.
setContainers
(
this
.
getContainer
(),
this
.
terminalContainer
);
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
);
return
TPromise
.
as
(
void
0
);
}
}
...
@@ -188,7 +195,7 @@ export class TerminalPanel extends Panel implements ITerminalPanel {
...
@@ -188,7 +195,7 @@ export class TerminalPanel extends Panel implements ITerminalPanel {
}
}
this
.
currentBaseThemeId
=
baseThemeId
;
this
.
currentBaseThemeId
=
baseThemeId
;
let
theme
=
this
.
configHelper
.
getTheme
(
baseThemeId
);
let
theme
=
this
.
terminalService
.
configHelper
.
getTheme
(
baseThemeId
);
let
css
=
''
;
let
css
=
''
;
theme
.
forEach
((
color
:
string
,
index
:
number
)
=>
{
theme
.
forEach
((
color
:
string
,
index
:
number
)
=>
{
...
@@ -222,8 +229,8 @@ export class TerminalPanel extends Panel implements ITerminalPanel {
...
@@ -222,8 +229,8 @@ export class TerminalPanel extends Panel implements ITerminalPanel {
if
(
this
.
terminalService
.
terminalInstances
.
length
===
0
)
{
if
(
this
.
terminalService
.
terminalInstances
.
length
===
0
)
{
return
;
return
;
}
}
let
newFont
=
this
.
configHelper
.
getFont
();
let
newFont
=
this
.
terminalService
.
configHelper
.
getFont
();
DOM
.
toggleClass
(
this
.
parentDomElement
,
'
enable-ligatures
'
,
this
.
configHelper
.
getFontLigaturesEnabled
());
DOM
.
toggleClass
(
this
.
parentDomElement
,
'
enable-ligatures
'
,
this
.
terminalService
.
configHelper
.
getFontLigaturesEnabled
());
if
(
!
this
.
font
||
this
.
fontsDiffer
(
this
.
font
,
newFont
))
{
if
(
!
this
.
font
||
this
.
fontsDiffer
(
this
.
font
,
newFont
))
{
this
.
fontStyleElement
.
innerHTML
=
'
.monaco-workbench .panel.integrated-terminal .xterm {
'
+
this
.
fontStyleElement
.
innerHTML
=
'
.monaco-workbench .panel.integrated-terminal .xterm {
'
+
`font-family:
${
newFont
.
fontFamily
}
;`
+
`font-family:
${
newFont
.
fontFamily
}
;`
+
...
@@ -246,13 +253,13 @@ export class TerminalPanel extends Panel implements ITerminalPanel {
...
@@ -246,13 +253,13 @@ export class TerminalPanel extends Panel implements ITerminalPanel {
private
updateCursorBlink
():
void
{
private
updateCursorBlink
():
void
{
this
.
terminalService
.
terminalInstances
.
forEach
((
instance
)
=>
{
this
.
terminalService
.
terminalInstances
.
forEach
((
instance
)
=>
{
instance
.
setCursorBlink
(
this
.
configHelper
.
getCursorBlink
());
instance
.
setCursorBlink
(
this
.
terminalService
.
configHelper
.
getCursorBlink
());
});
});
}
}
private
updateCommandsToSkipShell
():
void
{
private
updateCommandsToSkipShell
():
void
{
this
.
terminalService
.
terminalInstances
.
forEach
((
instance
)
=>
{
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 {
...
@@ -20,8 +20,10 @@ export class TerminalService implements ITerminalService {
public
_serviceBrand
:
any
;
public
_serviceBrand
:
any
;
private
_activeTerminalInstanceIndex
:
number
=
0
;
private
_activeTerminalInstanceIndex
:
number
=
0
;
private
_configHelper
:
TerminalConfigHelper
;
private
_terminalInstances
:
ITerminalInstance
[]
=
[];
private
_terminalInstances
:
ITerminalInstance
[]
=
[];
public
get
activeTerminalInstanceIndex
():
number
{
return
this
.
_activeTerminalInstanceIndex
;
}
public
get
activeTerminalInstanceIndex
():
number
{
return
this
.
_activeTerminalInstanceIndex
;
}
public
get
configHelper
():
TerminalConfigHelper
{
return
this
.
_configHelper
;
}
public
get
terminalInstances
():
ITerminalInstance
[]
{
return
this
.
_terminalInstances
;
}
public
get
terminalInstances
():
ITerminalInstance
[]
{
return
this
.
_terminalInstances
;
}
private
_onActiveInstanceChanged
:
Emitter
<
string
>
;
private
_onActiveInstanceChanged
:
Emitter
<
string
>
;
...
@@ -32,7 +34,6 @@ export class TerminalService implements ITerminalService {
...
@@ -32,7 +34,6 @@ export class TerminalService implements ITerminalService {
public
get
onInstanceTitleChanged
():
Event
<
string
>
{
return
this
.
_onInstanceTitleChanged
.
event
;
}
public
get
onInstanceTitleChanged
():
Event
<
string
>
{
return
this
.
_onInstanceTitleChanged
.
event
;
}
private
terminalContainer
:
HTMLElement
;
private
terminalContainer
:
HTMLElement
;
private
configHelper
:
TerminalConfigHelper
;
private
terminalFocusContextKey
:
IContextKey
<
boolean
>
;
private
terminalFocusContextKey
:
IContextKey
<
boolean
>
;
constructor
(
constructor
(
...
@@ -46,15 +47,17 @@ export class TerminalService implements ITerminalService {
...
@@ -46,15 +47,17 @@ export class TerminalService implements ITerminalService {
this
.
_onInstancesChanged
=
new
Emitter
<
string
>
();
this
.
_onInstancesChanged
=
new
Emitter
<
string
>
();
this
.
_onInstanceTitleChanged
=
new
Emitter
<
string
>
();
this
.
_onInstanceTitleChanged
=
new
Emitter
<
string
>
();
this
.
terminalFocusContextKey
=
KEYBINDING_CONTEXT_TERMINAL_FOCUS
.
bindTo
(
this
.
contextKeyService
);
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
{
public
createInstance
():
ITerminalInstance
{
console
.
log
(
'
creating instance
'
);
console
.
log
(
'
config helper
'
,
this
.
configHelper
);
let
terminalInstance
=
<
TerminalInstance
>
this
.
instantiationService
.
createInstance
(
TerminalInstance
,
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
);
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
();
this
.
_onInstancesChanged
.
fire
();
return
terminalInstance
;
return
terminalInstance
;
}
}
...
@@ -116,7 +119,7 @@ export class TerminalService implements ITerminalService {
...
@@ -116,7 +119,7 @@ export class TerminalService implements ITerminalService {
this
.
_terminalInstances
.
forEach
(
terminalInstance
=>
{
this
.
_terminalInstances
.
forEach
(
terminalInstance
=>
{
terminalInstance
.
attachToElement
(
this
.
terminalContainer
);
terminalInstance
.
attachToElement
(
this
.
terminalContainer
);
});
});
this
.
configHelper
.
panelContainer
=
panelContainer
;
this
.
_
configHelper
.
panelContainer
=
panelContainer
;
}
}
public
showPanel
(
focus
?:
boolean
):
TPromise
<
void
>
{
public
showPanel
(
focus
?:
boolean
):
TPromise
<
void
>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录