Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
1558fd55
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,发现更多精彩内容 >>
提交
1558fd55
编写于
6月 17, 2018
作者:
D
Daniel Imms
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Clear up references causing dispose issues in terminal
Part of #46356
上级
8557d611
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
32 addition
and
16 deletion
+32
-16
src/vs/workbench/parts/terminal/browser/terminalWidgetManager.ts
...workbench/parts/terminal/browser/terminalWidgetManager.ts
+9
-1
src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts
...kbench/parts/terminal/electron-browser/terminalActions.ts
+4
-3
src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts
...bench/parts/terminal/electron-browser/terminalInstance.ts
+12
-11
src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts
...ch/parts/terminal/electron-browser/terminalLinkHandler.ts
+1
-0
src/vs/workbench/parts/terminal/node/terminalCommandTracker.ts
...s/workbench/parts/terminal/node/terminalCommandTracker.ts
+6
-1
未找到文件。
src/vs/workbench/parts/terminal/browser/terminalWidgetManager.ts
浏览文件 @
1558fd55
...
...
@@ -7,7 +7,7 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle';
const
WIDGET_HEIGHT
=
29
;
export
class
TerminalWidgetManager
{
export
class
TerminalWidgetManager
implements
IDisposable
{
private
_container
:
HTMLElement
;
private
_xtermViewport
:
HTMLElement
;
...
...
@@ -24,6 +24,14 @@ export class TerminalWidgetManager {
this
.
_initTerminalHeightWatcher
(
terminalWrapper
);
}
public
dispose
():
void
{
if
(
this
.
_container
)
{
this
.
_container
.
parentElement
.
removeChild
(
this
.
_container
);
this
.
_container
=
null
;
}
this
.
_xtermViewport
=
null
;
}
private
_initTerminalHeightWatcher
(
terminalWrapper
:
HTMLElement
)
{
// Watch the xterm.js viewport for style changes and do a layout if it changes
this
.
_xtermViewport
=
<
HTMLElement
>
terminalWrapper
.
querySelector
(
'
.xterm-viewport
'
);
...
...
src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts
浏览文件 @
1558fd55
...
...
@@ -71,9 +71,10 @@ export class KillTerminalAction extends Action {
}
public
run
(
event
?:
any
):
TPromise
<
any
>
{
const
terminalInstance
=
this
.
terminalService
.
getActiveInstance
();
if
(
terminalInstance
)
{
this
.
terminalService
.
getActiveInstance
().
dispose
();
console
.
log
(
'
kill
'
);
const
instance
=
this
.
terminalService
.
getActiveInstance
();
if
(
instance
)
{
instance
.
dispose
();
if
(
this
.
terminalService
.
terminalInstances
.
length
>
0
)
{
this
.
terminalService
.
showPanel
(
true
);
}
...
...
src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts
浏览文件 @
1558fd55
...
...
@@ -155,14 +155,14 @@ export class TerminalInstance implements ITerminalInstance {
}
});
this
.
_configurationService
.
onDidChangeConfiguration
(
e
=>
{
this
.
addDisposable
(
this
.
_configurationService
.
onDidChangeConfiguration
(
e
=>
{
if
(
e
.
affectsConfiguration
(
'
terminal.integrated
'
))
{
this
.
updateConfig
();
}
if
(
e
.
affectsConfiguration
(
'
editor.accessibilitySupport
'
))
{
this
.
updateAccessibilitySupport
();
}
});
})
)
;
}
public
addDisposable
(
disposable
:
lifecycle
.
IDisposable
):
void
{
...
...
@@ -558,18 +558,21 @@ export class TerminalInstance implements ITerminalInstance {
public
dispose
():
void
{
this
.
_logService
.
trace
(
`terminalInstance#dispose (id:
${
this
.
id
}
)`
);
if
(
this
.
_windowsShellHelper
)
{
this
.
_windowsShellHelper
.
dispose
();
}
if
(
this
.
_linkHandler
)
{
this
.
_linkHandler
.
dispose
();
}
this
.
_windowsShellHelper
=
lifecycle
.
dispose
(
this
.
_windowsShellHelper
);
this
.
_linkHandler
=
lifecycle
.
dispose
(
this
.
_linkHandler
);
this
.
_commandTracker
=
lifecycle
.
dispose
(
this
.
_commandTracker
);
this
.
_widgetManager
=
lifecycle
.
dispose
(
this
.
_widgetManager
);
if
(
this
.
_xterm
&&
this
.
_xterm
.
element
)
{
this
.
_hadFocusOnExit
=
dom
.
hasClass
(
this
.
_xterm
.
element
,
'
focus
'
);
}
if
(
this
.
_wrapperElement
)
{
if
((
<
any
>
this
.
_wrapperElement
).
xterm
)
{
(
<
any
>
this
.
_wrapperElement
).
xterm
=
null
;
}
this
.
_container
.
removeChild
(
this
.
_wrapperElement
);
this
.
_wrapperElement
=
null
;
this
.
_xtermElement
=
null
;
}
if
(
this
.
_xterm
)
{
const
buffer
=
(
<
any
>
this
.
_xterm
.
buffer
);
...
...
@@ -577,9 +580,7 @@ export class TerminalInstance implements ITerminalInstance {
this
.
_xterm
.
dispose
();
this
.
_xterm
=
null
;
}
if
(
this
.
_processManager
)
{
this
.
_processManager
.
dispose
();
}
this
.
_processManager
=
lifecycle
.
dispose
(
this
.
_processManager
);
if
(
!
this
.
_isDisposed
)
{
this
.
_isDisposed
=
true
;
this
.
_onDisposed
.
fire
(
this
);
...
...
src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts
浏览文件 @
1558fd55
...
...
@@ -121,6 +121,7 @@ export class TerminalLinkHandler {
}
public
dispose
():
void
{
this
.
_xterm
=
null
;
this
.
_hoverDisposables
=
dispose
(
this
.
_hoverDisposables
);
this
.
_mouseMoveDisposable
=
dispose
(
this
.
_mouseMoveDisposable
);
}
...
...
src/vs/workbench/parts/terminal/node/terminalCommandTracker.ts
浏览文件 @
1558fd55
...
...
@@ -5,6 +5,7 @@
import
{
Terminal
,
IMarker
}
from
'
vscode-xterm
'
;
import
{
ITerminalCommandTracker
}
from
'
vs/workbench/parts/terminal/common/terminal
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
/**
* The minimize size of the prompt in which to assume the line is a command.
...
...
@@ -21,7 +22,7 @@ export enum ScrollPosition {
Middle
}
export
class
TerminalCommandTracker
implements
ITerminalCommandTracker
{
export
class
TerminalCommandTracker
implements
ITerminalCommandTracker
,
IDisposable
{
private
_currentMarker
:
IMarker
|
Boundary
=
Boundary
.
Bottom
;
private
_selectionStart
:
IMarker
|
Boundary
|
null
=
null
;
private
_isDisposable
:
boolean
=
false
;
...
...
@@ -32,6 +33,10 @@ export class TerminalCommandTracker implements ITerminalCommandTracker {
this
.
_xterm
.
on
(
'
key
'
,
key
=>
this
.
_onKey
(
key
));
}
public
dispose
():
void
{
this
.
_xterm
=
null
;
}
private
_onKey
(
key
:
string
):
void
{
if
(
key
===
'
\
x0d
'
)
{
this
.
_onEnter
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录