Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
4dbb6571
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,发现更多精彩内容 >>
提交
4dbb6571
编写于
5月 24, 2016
作者:
D
Daniel Imms
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Don't reply terminal shell on error, dismiss terminal when exited
Fixes #6683 Fixes #6762
上级
025009b5
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
26 addition
and
16 deletion
+26
-16
src/vs/workbench/parts/terminal/common/terminal.ts
src/vs/workbench/parts/terminal/common/terminal.ts
+1
-1
src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts
...kbench/parts/terminal/electron-browser/terminalActions.ts
+2
-2
src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts
...orkbench/parts/terminal/electron-browser/terminalPanel.ts
+19
-9
src/vs/workbench/parts/terminal/electron-browser/terminalProcess.js
...kbench/parts/terminal/electron-browser/terminalProcess.js
+3
-3
src/vs/workbench/parts/terminal/electron-browser/terminalService.ts
...kbench/parts/terminal/electron-browser/terminalService.ts
+1
-1
未找到文件。
src/vs/workbench/parts/terminal/common/terminal.ts
浏览文件 @
4dbb6571
...
...
@@ -51,5 +51,5 @@ export interface ITerminalConfiguration {
export
interface
ITerminalService
{
serviceId
:
ServiceIdentifier
<
any
>
;
show
():
TPromise
<
any
>
;
toggle
():
TPromise
<
any
>
;
}
src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts
浏览文件 @
4dbb6571
...
...
@@ -10,7 +10,7 @@ import {ITerminalService} from 'vs/workbench/parts/terminal/common/terminal';
export
class
ToggleTerminalAction
extends
Action
{
public
static
ID
=
'
workbench.action.terminal.toggle
Terminal
'
;
public
static
ID
=
'
workbench.action.terminal.toggle
'
;
public
static
LABEL
=
nls
.
localize
(
'
toggleTerminal
'
,
"
Toggle Integrated Terminal
"
);
constructor
(
...
...
@@ -21,6 +21,6 @@ export class ToggleTerminalAction extends Action {
}
public
run
(
event
?:
any
):
TPromise
<
any
>
{
return
this
.
terminalService
.
show
();
return
this
.
terminalService
.
toggle
();
}
}
\ No newline at end of file
src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts
浏览文件 @
4dbb6571
...
...
@@ -17,7 +17,7 @@ import {IConfigurationService} from 'vs/platform/configuration/common/configurat
import
{
IStringDictionary
}
from
'
vs/base/common/collections
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
ITerminalConfiguration
,
TERMINAL_PANEL_ID
}
from
'
vs/workbench/parts/terminal/common/terminal
'
;
import
{
ITerminalConfiguration
,
ITerminalService
,
TERMINAL_PANEL_ID
}
from
'
vs/workbench/parts/terminal/common/terminal
'
;
import
{
Panel
}
from
'
vs/workbench/browser/panel
'
;
import
{
DomScrollableElement
}
from
'
vs/base/browser/ui/scrollbar/scrollableElement
'
;
import
{
ScrollbarVisibility
}
from
'
vs/base/browser/ui/scrollbar/scrollableElementOptions
'
;
...
...
@@ -36,7 +36,8 @@ export class TerminalPanel extends Panel {
constructor
(
@
IConfigurationService
private
configurationService
:
IConfigurationService
,
@
ITelemetryService
telemetryService
:
ITelemetryService
,
@
IWorkspaceContextService
private
contextService
:
IWorkspaceContextService
@
IWorkspaceContextService
private
contextService
:
IWorkspaceContextService
,
@
ITerminalService
private
terminalService
:
ITerminalService
)
{
super
(
TERMINAL_PANEL_ID
,
telemetryService
);
this
.
toDispose
=
[];
...
...
@@ -46,12 +47,14 @@ export class TerminalPanel extends Panel {
let
cols
=
Math
.
floor
(
this
.
parentDomElement
.
offsetWidth
/
TERMINAL_CHAR_WIDTH
);
let
rows
=
Math
.
floor
(
this
.
parentDomElement
.
offsetHeight
/
TERMINAL_CHAR_HEIGHT
);
this
.
terminal
.
resize
(
cols
,
rows
);
if
(
this
.
ptyProcess
.
connected
)
{
this
.
ptyProcess
.
send
({
event
:
'
resize
'
,
cols
:
cols
,
rows
:
rows
});
}
}
public
create
(
parent
:
Builder
):
TPromise
<
void
>
{
super
.
create
(
parent
);
...
...
@@ -103,12 +106,19 @@ export class TerminalPanel extends Panel {
});
return
false
;
});
this
.
ptyProcess
.
on
(
'
exit
'
,
(
data
)
=>
{
this
.
ptyProcess
.
on
(
'
exit
'
,
(
exitCode
)
=>
{
this
.
toDispose
=
lifecycle
.
dispose
(
this
.
toDispose
);
this
.
terminal
.
destroy
();
// TODO: When multiple terminals are supported this should do something smarter. There is
// also a weird bug here at least on Ubuntu 15.10 where the new terminal text does not
// repaint correctly.
if
(
exitCode
===
0
)
{
this
.
createTerminal
();
}
else
{
// TODO: Allow the terminal to be relaunched after an error
console
.
error
(
'
Integrated terminal exited with code
'
+
exitCode
);
}
this
.
terminalService
.
toggle
();
});
this
.
toDispose
.
push
(
DOM
.
addDisposableListener
(
this
.
parentDomElement
,
'
mousedown
'
,
(
event
)
=>
{
// Drop selection and focus terminal on Linux to enable middle button paste when click
...
...
src/vs/workbench/parts/terminal/electron-browser/terminalProcess.js
浏览文件 @
4dbb6571
...
...
@@ -17,9 +17,9 @@ ptyProcess.on('data', function (data) {
process
.
send
(
data
);
});
ptyProcess
.
on
(
'
exit
'
,
function
()
{
process
.
exit
(
0
);
})
ptyProcess
.
on
(
'
exit
'
,
function
(
exitCode
)
{
process
.
exit
(
exitCode
);
})
;
process
.
on
(
'
message
'
,
function
(
message
)
{
if
(
message
.
event
===
'
input
'
)
{
...
...
src/vs/workbench/parts/terminal/electron-browser/terminalService.ts
浏览文件 @
4dbb6571
...
...
@@ -17,7 +17,7 @@ export class TerminalService implements ITerminalService {
)
{
}
public
show
():
TPromise
<
any
>
{
public
toggle
():
TPromise
<
any
>
{
const
panel
=
this
.
panelService
.
getActivePanel
();
if
(
panel
&&
panel
.
getId
()
===
TERMINAL_PANEL_ID
)
{
this
.
partService
.
setPanelHidden
(
true
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录