Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
1f7ce421
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,发现更多精彩内容 >>
提交
1f7ce421
编写于
8月 28, 2018
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "Kill processes immediately on shutdown, use SIGTERM"
This reverts commit
95c0e072
.
上级
ba7f67ae
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
27 addition
and
50 deletion
+27
-50
src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts
...rkbench/api/electron-browser/mainThreadTerminalService.ts
+1
-1
src/vs/workbench/api/node/extHost.protocol.ts
src/vs/workbench/api/node/extHost.protocol.ts
+1
-1
src/vs/workbench/api/node/extHostTerminalService.ts
src/vs/workbench/api/node/extHostTerminalService.ts
+2
-2
src/vs/workbench/parts/terminal/common/terminal.ts
src/vs/workbench/parts/terminal/common/terminal.ts
+2
-6
src/vs/workbench/parts/terminal/common/terminalService.ts
src/vs/workbench/parts/terminal/common/terminalService.ts
+1
-1
src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts
...bench/parts/terminal/electron-browser/terminalInstance.ts
+2
-2
src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts
...parts/terminal/electron-browser/terminalProcessManager.ts
+2
-2
src/vs/workbench/parts/terminal/node/terminal.ts
src/vs/workbench/parts/terminal/node/terminal.ts
+1
-7
src/vs/workbench/parts/terminal/node/terminalProcess.ts
src/vs/workbench/parts/terminal/node/terminalProcess.ts
+11
-23
src/vs/workbench/parts/terminal/node/terminalProcessExtHostProxy.ts
...kbench/parts/terminal/node/terminalProcessExtHostProxy.ts
+4
-5
未找到文件。
src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts
浏览文件 @
1f7ce421
...
@@ -199,7 +199,7 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
...
@@ -199,7 +199,7 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
this
.
_proxy
.
$createProcess
(
request
.
proxy
.
terminalId
,
shellLaunchConfigDto
,
request
.
cols
,
request
.
rows
);
this
.
_proxy
.
$createProcess
(
request
.
proxy
.
terminalId
,
shellLaunchConfigDto
,
request
.
cols
,
request
.
rows
);
request
.
proxy
.
onInput
(
data
=>
this
.
_proxy
.
$acceptProcessInput
(
request
.
proxy
.
terminalId
,
data
));
request
.
proxy
.
onInput
(
data
=>
this
.
_proxy
.
$acceptProcessInput
(
request
.
proxy
.
terminalId
,
data
));
request
.
proxy
.
onResize
(
dimensions
=>
this
.
_proxy
.
$acceptProcessResize
(
request
.
proxy
.
terminalId
,
dimensions
.
cols
,
dimensions
.
rows
));
request
.
proxy
.
onResize
(
dimensions
=>
this
.
_proxy
.
$acceptProcessResize
(
request
.
proxy
.
terminalId
,
dimensions
.
cols
,
dimensions
.
rows
));
request
.
proxy
.
onShutdown
(
immediate
=>
this
.
_proxy
.
$acceptProcessShutdown
(
request
.
proxy
.
terminalId
,
immediate
));
request
.
proxy
.
onShutdown
(
()
=>
this
.
_proxy
.
$acceptProcessShutdown
(
request
.
proxy
.
terminalId
));
}
}
public
$sendProcessTitle
(
terminalId
:
number
,
title
:
string
):
void
{
public
$sendProcessTitle
(
terminalId
:
number
,
title
:
string
):
void
{
...
...
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
1f7ce421
...
@@ -878,7 +878,7 @@ export interface ExtHostTerminalServiceShape {
...
@@ -878,7 +878,7 @@ export interface ExtHostTerminalServiceShape {
$createProcess
(
id
:
number
,
shellLaunchConfig
:
ShellLaunchConfigDto
,
cols
:
number
,
rows
:
number
):
void
;
$createProcess
(
id
:
number
,
shellLaunchConfig
:
ShellLaunchConfigDto
,
cols
:
number
,
rows
:
number
):
void
;
$acceptProcessInput
(
id
:
number
,
data
:
string
):
void
;
$acceptProcessInput
(
id
:
number
,
data
:
string
):
void
;
$acceptProcessResize
(
id
:
number
,
cols
:
number
,
rows
:
number
):
void
;
$acceptProcessResize
(
id
:
number
,
cols
:
number
,
rows
:
number
):
void
;
$acceptProcessShutdown
(
id
:
number
,
immediate
:
boolean
):
void
;
$acceptProcessShutdown
(
id
:
number
):
void
;
}
}
export
interface
ExtHostSCMShape
{
export
interface
ExtHostSCMShape
{
...
...
src/vs/workbench/api/node/extHostTerminalService.ts
浏览文件 @
1f7ce421
...
@@ -415,8 +415,8 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape {
...
@@ -415,8 +415,8 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape {
}
}
}
}
public
$acceptProcessShutdown
(
id
:
number
,
immediate
:
boolean
):
void
{
public
$acceptProcessShutdown
(
id
:
number
):
void
{
this
.
_terminalProcesses
[
id
].
shutdown
(
immediate
);
this
.
_terminalProcesses
[
id
].
shutdown
();
}
}
private
_onProcessExit
(
id
:
number
,
exitCode
:
number
):
void
{
private
_onProcessExit
(
id
:
number
,
exitCode
:
number
):
void
{
...
...
src/vs/workbench/parts/terminal/common/terminal.ts
浏览文件 @
1f7ce421
...
@@ -382,11 +382,8 @@ export interface ITerminalInstance {
...
@@ -382,11 +382,8 @@ export interface ITerminalInstance {
/**
/**
* Dispose the terminal instance, removing it from the panel/service and freeing up resources.
* Dispose the terminal instance, removing it from the panel/service and freeing up resources.
*
* @param isShuttingDown Whether VS Code is shutting down, if so kill any terminal processes
* immediately.
*/
*/
dispose
(
isShuttingDown
?:
boolean
):
void
;
dispose
():
void
;
/**
/**
* Registers a link matcher, allowing custom link patterns to be matched and handled.
* Registers a link matcher, allowing custom link patterns to be matched and handled.
...
@@ -576,7 +573,6 @@ export interface ITerminalProcessManager extends IDisposable {
...
@@ -576,7 +573,6 @@ export interface ITerminalProcessManager extends IDisposable {
readonly
onProcessExit
:
Event
<
number
>
;
readonly
onProcessExit
:
Event
<
number
>
;
addDisposable
(
disposable
:
IDisposable
);
addDisposable
(
disposable
:
IDisposable
);
dispose
(
immediate
?:
boolean
);
createProcess
(
shellLaunchConfig
:
IShellLaunchConfig
,
cols
:
number
,
rows
:
number
);
createProcess
(
shellLaunchConfig
:
IShellLaunchConfig
,
cols
:
number
,
rows
:
number
);
write
(
data
:
string
):
void
;
write
(
data
:
string
):
void
;
setDimensions
(
cols
:
number
,
rows
:
number
):
void
;
setDimensions
(
cols
:
number
,
rows
:
number
):
void
;
...
@@ -612,7 +608,7 @@ export interface ITerminalProcessExtHostProxy extends IDisposable {
...
@@ -612,7 +608,7 @@ export interface ITerminalProcessExtHostProxy extends IDisposable {
onInput
:
Event
<
string
>
;
onInput
:
Event
<
string
>
;
onResize
:
Event
<
{
cols
:
number
,
rows
:
number
}
>
;
onResize
:
Event
<
{
cols
:
number
,
rows
:
number
}
>
;
onShutdown
:
Event
<
boolean
>
;
onShutdown
:
Event
<
void
>
;
}
}
export
interface
ITerminalProcessExtHostRequest
{
export
interface
ITerminalProcessExtHostRequest
{
...
...
src/vs/workbench/parts/terminal/common/terminalService.ts
浏览文件 @
1f7ce421
...
@@ -113,7 +113,7 @@ export abstract class TerminalService implements ITerminalService {
...
@@ -113,7 +113,7 @@ export abstract class TerminalService implements ITerminalService {
private
_onShutdown
():
void
{
private
_onShutdown
():
void
{
// Dispose of all instances
// Dispose of all instances
this
.
terminalInstances
.
forEach
(
instance
=>
instance
.
dispose
(
true
));
this
.
terminalInstances
.
forEach
(
instance
=>
instance
.
dispose
());
}
}
public
getTabLabels
():
string
[]
{
public
getTabLabels
():
string
[]
{
...
...
src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts
浏览文件 @
1f7ce421
...
@@ -563,7 +563,7 @@ export class TerminalInstance implements ITerminalInstance {
...
@@ -563,7 +563,7 @@ export class TerminalInstance implements ITerminalInstance {
this
.
_terminalFocusContextKey
.
set
(
terminalFocused
);
this
.
_terminalFocusContextKey
.
set
(
terminalFocused
);
}
}
public
dispose
(
isShuttingDown
?:
boolean
):
void
{
public
dispose
():
void
{
this
.
_logService
.
trace
(
`terminalInstance#dispose (id:
${
this
.
id
}
)`
);
this
.
_logService
.
trace
(
`terminalInstance#dispose (id:
${
this
.
id
}
)`
);
this
.
_windowsShellHelper
=
lifecycle
.
dispose
(
this
.
_windowsShellHelper
);
this
.
_windowsShellHelper
=
lifecycle
.
dispose
(
this
.
_windowsShellHelper
);
...
@@ -588,7 +588,7 @@ export class TerminalInstance implements ITerminalInstance {
...
@@ -588,7 +588,7 @@ export class TerminalInstance implements ITerminalInstance {
this
.
_xterm
.
dispose
();
this
.
_xterm
.
dispose
();
this
.
_xterm
=
null
;
this
.
_xterm
=
null
;
}
}
this
.
_processManager
.
dispose
(
isShuttingDown
);
this
.
_processManager
=
lifecycle
.
dispose
(
this
.
_processManager
);
if
(
!
this
.
_isDisposed
)
{
if
(
!
this
.
_isDisposed
)
{
this
.
_isDisposed
=
true
;
this
.
_isDisposed
=
true
;
this
.
_onDisposed
.
fire
(
this
);
this
.
_onDisposed
.
fire
(
this
);
...
...
src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts
浏览文件 @
1f7ce421
...
@@ -65,13 +65,13 @@ export class TerminalProcessManager implements ITerminalProcessManager {
...
@@ -65,13 +65,13 @@ export class TerminalProcessManager implements ITerminalProcessManager {
});
});
}
}
public
dispose
(
immediate
?:
boolean
):
void
{
public
dispose
():
void
{
if
(
this
.
_process
)
{
if
(
this
.
_process
)
{
// If the process was still connected this dispose came from
// If the process was still connected this dispose came from
// within VS Code, not the process, so mark the process as
// within VS Code, not the process, so mark the process as
// killed by the user.
// killed by the user.
this
.
processState
=
ProcessState
.
KILLED_BY_USER
;
this
.
processState
=
ProcessState
.
KILLED_BY_USER
;
this
.
_process
.
shutdown
(
immediate
);
this
.
_process
.
shutdown
();
this
.
_process
=
null
;
this
.
_process
=
null
;
}
}
this
.
_disposables
.
forEach
(
d
=>
d
.
dispose
());
this
.
_disposables
.
forEach
(
d
=>
d
.
dispose
());
...
...
src/vs/workbench/parts/terminal/node/terminal.ts
浏览文件 @
1f7ce421
...
@@ -19,13 +19,7 @@ export interface ITerminalChildProcess {
...
@@ -19,13 +19,7 @@ export interface ITerminalChildProcess {
onProcessIdReady
:
Event
<
number
>
;
onProcessIdReady
:
Event
<
number
>
;
onProcessTitleChanged
:
Event
<
string
>
;
onProcessTitleChanged
:
Event
<
string
>
;
/**
shutdown
():
void
;
* Shutdown the terminal process.
*
* @param immediate When true the process will be killed immediately, otherwise the process will
* be given some time to make sure no additional data comes through.
*/
shutdown
(
immediate
:
boolean
):
void
;
input
(
data
:
string
):
void
;
input
(
data
:
string
):
void
;
resize
(
cols
:
number
,
rows
:
number
):
void
;
resize
(
cols
:
number
,
rows
:
number
):
void
;
}
}
...
...
src/vs/workbench/parts/terminal/node/terminalProcess.ts
浏览文件 @
1f7ce421
...
@@ -97,25 +97,17 @@ export class TerminalProcess implements ITerminalChildProcess, IDisposable {
...
@@ -97,25 +97,17 @@ export class TerminalProcess implements ITerminalChildProcess, IDisposable {
if
(
this
.
_closeTimeout
)
{
if
(
this
.
_closeTimeout
)
{
clearTimeout
(
this
.
_closeTimeout
);
clearTimeout
(
this
.
_closeTimeout
);
}
}
this
.
_closeTimeout
=
setTimeout
(()
=>
this
.
_kill
(),
250
);
this
.
_closeTimeout
=
setTimeout
(()
=>
{
}
// Attempt to kill the pty, it may have already been killed at this
// point but we want to make sure
private
_kill
():
void
{
try
{
// Attempt to kill the pty, it may have already been killed at this
// point but we want to make sure
try
{
if
(
!
platform
.
isWindows
)
{
// Send SIGTERM, SIGHUP does not seem to work when the parent process dies
// immediately after.
process
.
kill
(
this
.
_ptyProcess
.
pid
,
'
SIGTERM
'
);
}
else
{
this
.
_ptyProcess
.
kill
();
this
.
_ptyProcess
.
kill
();
}
catch
(
ex
)
{
// Swallow, the pty has already been killed
}
}
}
catch
(
ex
)
{
this
.
_onProcessExit
.
fire
(
this
.
_exitCode
);
// Swallow, the pty has already been killed
this
.
dispose
();
}
},
250
);
this
.
_onProcessExit
.
fire
(
this
.
_exitCode
);
this
.
dispose
();
}
}
private
_sendProcessId
()
{
private
_sendProcessId
()
{
...
@@ -127,12 +119,8 @@ export class TerminalProcess implements ITerminalChildProcess, IDisposable {
...
@@ -127,12 +119,8 @@ export class TerminalProcess implements ITerminalChildProcess, IDisposable {
this
.
_onProcessTitleChanged
.
fire
(
this
.
_currentTitle
);
this
.
_onProcessTitleChanged
.
fire
(
this
.
_currentTitle
);
}
}
public
shutdown
(
immediate
:
boolean
):
void
{
public
shutdown
():
void
{
if
(
immediate
)
{
this
.
_queueProcessExit
();
this
.
_kill
();
}
else
{
this
.
_queueProcessExit
();
}
}
}
public
input
(
data
:
string
):
void
{
public
input
(
data
:
string
):
void
{
...
...
src/vs/workbench/parts/terminal/node/terminalProcessExtHostProxy.ts
浏览文件 @
1f7ce421
...
@@ -25,8 +25,8 @@ export class TerminalProcessExtHostProxy implements ITerminalChildProcess, ITerm
...
@@ -25,8 +25,8 @@ export class TerminalProcessExtHostProxy implements ITerminalChildProcess, ITerm
public
get
onInput
():
Event
<
string
>
{
return
this
.
_onInput
.
event
;
}
public
get
onInput
():
Event
<
string
>
{
return
this
.
_onInput
.
event
;
}
private
readonly
_onResize
:
Emitter
<
{
cols
:
number
,
rows
:
number
}
>
=
new
Emitter
<
{
cols
:
number
,
rows
:
number
}
>
();
private
readonly
_onResize
:
Emitter
<
{
cols
:
number
,
rows
:
number
}
>
=
new
Emitter
<
{
cols
:
number
,
rows
:
number
}
>
();
public
get
onResize
():
Event
<
{
cols
:
number
,
rows
:
number
}
>
{
return
this
.
_onResize
.
event
;
}
public
get
onResize
():
Event
<
{
cols
:
number
,
rows
:
number
}
>
{
return
this
.
_onResize
.
event
;
}
private
readonly
_onShutdown
:
Emitter
<
boolean
>
=
new
Emitter
<
boolean
>
();
private
readonly
_onShutdown
:
Emitter
<
void
>
=
new
Emitter
<
void
>
();
public
get
onShutdown
():
Event
<
boolean
>
{
return
this
.
_onShutdown
.
event
;
}
public
get
onShutdown
():
Event
<
void
>
{
return
this
.
_onShutdown
.
event
;
}
constructor
(
constructor
(
public
terminalId
:
number
,
public
terminalId
:
number
,
...
@@ -65,9 +65,8 @@ export class TerminalProcessExtHostProxy implements ITerminalChildProcess, ITerm
...
@@ -65,9 +65,8 @@ export class TerminalProcessExtHostProxy implements ITerminalChildProcess, ITerm
this
.
_onProcessExit
.
fire
(
exitCode
);
this
.
_onProcessExit
.
fire
(
exitCode
);
this
.
dispose
();
this
.
dispose
();
}
}
public
shutdown
():
void
{
public
shutdown
(
immediate
:
boolean
):
void
{
this
.
_onShutdown
.
fire
();
this
.
_onShutdown
.
fire
(
immediate
);
}
}
public
input
(
data
:
string
):
void
{
public
input
(
data
:
string
):
void
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录