Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
ad62caf3
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,发现更多精彩内容 >>
提交
ad62caf3
编写于
7月 19, 2017
作者:
A
Amy Qiu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove timeout and fix event trigger
上级
509f4b38
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
15 addition
and
14 deletion
+15
-14
src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts
...bench/parts/terminal/electron-browser/terminalInstance.ts
+7
-1
src/vs/workbench/parts/terminal/electron-browser/windowsShellHelper.ts
...nch/parts/terminal/electron-browser/windowsShellHelper.ts
+8
-13
未找到文件。
src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts
浏览文件 @
ad62caf3
...
...
@@ -143,6 +143,11 @@ export class TerminalInstance implements ITerminalInstance {
if
(
platform
.
isWindows
)
{
this
.
_processReady
.
then
(()
=>
{
this
.
_windowsShellHelper
=
new
WindowsShellHelper
(
this
.
_processId
,
this
.
_shellLaunchConfig
.
executable
);
}).
then
(()
=>
{
this
.
_windowsShellHelper
.
updateShellName
().
then
(
result
=>
{
this
.
_title
=
result
;
this
.
_onTitleChanged
.
fire
(
result
);
});
});
}
...
...
@@ -273,9 +278,10 @@ export class TerminalInstance implements ITerminalInstance {
return
false
;
}
if
(
platform
.
isWindows
&&
event
.
keyCode
===
13
/* ENTER */
&&
!
this
.
_messageTitleListener
)
{
if
(
platform
.
isWindows
&&
event
.
keyCode
===
13
/* ENTER */
&&
this
.
_messageTitleListener
)
{
this
.
_windowsShellHelper
.
updateShellName
().
then
(
result
=>
{
this
.
_title
=
result
;
this
.
_onTitleChanged
.
fire
(
result
);
});
}
...
...
src/vs/workbench/parts/terminal/electron-browser/windowsShellHelper.ts
浏览文件 @
ad62caf3
...
...
@@ -9,9 +9,6 @@ import * as path from 'path';
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
Emitter
,
debounceEvent
}
from
'
vs/base/common/event
'
;
/** The amount of time to wait before getting the shell process name */
const
WAIT_AFTER_ENTER_TIME
=
100
;
export
class
WindowsShellHelper
{
private
_childProcessIdStack
:
number
[];
private
_onCheckWindowsShell
:
Emitter
<
string
>
;
...
...
@@ -21,6 +18,8 @@ export class WindowsShellHelper {
public
constructor
(
pid
:
number
,
rootShellName
:
string
)
{
this
.
_childProcessIdStack
=
[];
this
.
_rootShellExecutable
=
rootShellName
;
this
.
_processId
=
pid
;
if
(
!
platform
.
isWindows
)
{
throw
new
Error
(
`WindowsShellHelper cannot be instantiated on
${
platform
.
platform
}
`
);
}
...
...
@@ -73,16 +72,12 @@ export class WindowsShellHelper {
this
.
_childProcessIdStack
.
push
(
pid
);
}
return
new
TPromise
<
string
>
((
resolve
)
=>
{
// We wait before checking the processes to give it time to update with the new child shell.
// Otherwise, it would return old data.
setTimeout
(()
=>
{
this
.
refreshShellProcessTree
(
this
.
_childProcessIdStack
[
this
.
_childProcessIdStack
.
length
-
1
],
''
).
then
(
result
=>
{
if
(
result
.
length
>
0
)
{
resolve
(
result
);
}
resolve
(
shell
);
},
error
=>
{
return
error
;
});
},
WAIT_AFTER_ENTER_TIME
);
this
.
refreshShellProcessTree
(
this
.
_childProcessIdStack
[
this
.
_childProcessIdStack
.
length
-
1
],
''
).
then
(
result
=>
{
if
(
result
.
length
>
0
)
{
resolve
(
result
);
}
resolve
(
shell
);
},
error
=>
{
return
error
;
});
});
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录