Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
9d16f3c1
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,体验更适合开发者的 AI 搜索 >>
提交
9d16f3c1
编写于
8月 16, 2016
作者:
D
Daniel Imms
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Support setting terminal name
上级
0d902387
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
17 addition
and
15 deletion
+17
-15
src/vs/vscode.d.ts
src/vs/vscode.d.ts
+1
-1
src/vs/workbench/api/node/mainThreadTerminalService.ts
src/vs/workbench/api/node/mainThreadTerminalService.ts
+1
-2
src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts
...orkbench/parts/terminal/electron-browser/terminalPanel.ts
+2
-2
src/vs/workbench/parts/terminal/electron-browser/terminalService.ts
...kbench/parts/terminal/electron-browser/terminalService.ts
+13
-10
未找到文件。
src/vs/vscode.d.ts
浏览文件 @
9d16f3c1
...
...
@@ -3465,7 +3465,7 @@ declare namespace vscode {
*/
export
function
createStatusBarItem
(
alignment
?:
StatusBarAlignment
,
priority
?:
number
):
StatusBarItem
;
export
function
createTerminal
(
name
?:
string
):
Thenable
<
vscode
.
Terminal
>
;
export
function
createTerminal
(
label
?:
string
):
Thenable
<
vscode
.
Terminal
>
;
}
/**
...
...
src/vs/workbench/api/node/mainThreadTerminalService.ts
浏览文件 @
9d16f3c1
...
...
@@ -20,8 +20,7 @@ export class MainThreadTerminalService extends MainThreadTerminalServiceShape {
}
public
$createTerminal
(
name
?:
string
):
TPromise
<
number
>
{
// TODO: Use name here
return
this
.
_terminalService
.
createNew
();
return
this
.
_terminalService
.
createNew
(
name
);
}
public
$show
(
terminalId
:
number
,
preserveFocus
:
boolean
):
void
{
...
...
src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts
浏览文件 @
9d16f3c1
...
...
@@ -174,8 +174,8 @@ export class TerminalPanel extends Panel {
}));
}
public
createNewTerminalInstance
(
terminalProcess
:
ITerminalProcess
,
terminalF
ocusContextKey
:
IContextKey
<
boolean
>
):
TPromise
<
number
>
{
return
this
.
createTerminal
(
terminalProcess
,
terminalF
ocusContextKey
).
then
((
terminalInstance
)
=>
{
public
createNewTerminalInstance
(
process
:
ITerminalProcess
,
f
ocusContextKey
:
IContextKey
<
boolean
>
):
TPromise
<
number
>
{
return
this
.
createTerminal
(
process
,
f
ocusContextKey
).
then
((
terminalInstance
)
=>
{
this
.
updateConfig
();
this
.
focus
();
return
TPromise
.
as
(
terminalInstance
.
id
);
...
...
src/vs/workbench/parts/terminal/electron-browser/terminalService.ts
浏览文件 @
9d16f3c1
...
...
@@ -152,7 +152,7 @@ export class TerminalService implements ITerminalService {
return
this
.
focus
();
}
public
createNew
():
TPromise
<
number
>
{
public
createNew
(
name
?:
string
):
TPromise
<
number
>
{
let
self
=
this
;
let
processCount
=
this
.
terminalProcesses
.
length
;
...
...
@@ -170,7 +170,7 @@ export class TerminalService implements ITerminalService {
}
self
.
initConfigHelper
(
terminalPanel
.
getContainer
());
return
terminalPanel
.
createNewTerminalInstance
(
self
.
createTerminalProcess
(),
this
.
_terminalFocusContextKey
).
then
((
terminalId
)
=>
{
return
terminalPanel
.
createNewTerminalInstance
(
self
.
createTerminalProcess
(
name
),
this
.
_terminalFocusContextKey
).
then
((
terminalId
)
=>
{
self
.
_onInstancesChanged
.
fire
();
return
TPromise
.
as
(
terminalId
);
});
...
...
@@ -245,11 +245,11 @@ export class TerminalService implements ITerminalService {
}
}
private
createTerminalProcess
():
ITerminalProcess
{
private
createTerminalProcess
(
name
?:
string
):
ITerminalProcess
{
let
locale
=
this
.
configHelper
.
isSetLocaleVariables
()
?
platform
.
locale
:
undefined
;
let
env
=
TerminalService
.
createTerminalEnv
(
process
.
env
,
this
.
configHelper
.
getShell
(),
this
.
contextService
.
getWorkspace
(),
locale
);
let
terminalProcess
=
{
title
:
''
,
title
:
name
,
process
:
cp
.
fork
(
'
./terminalProcess
'
,
[],
{
env
:
env
,
cwd
:
URI
.
parse
(
path
.
dirname
(
require
.
toUrl
(
'
./terminalProcess
'
))).
fsPath
...
...
@@ -259,12 +259,15 @@ export class TerminalService implements ITerminalService {
this
.
_onInstancesChanged
.
fire
();
this
.
activeTerminalIndex
=
this
.
terminalProcesses
.
length
-
1
;
this
.
_onActiveInstanceChanged
.
fire
();
terminalProcess
.
process
.
on
(
'
message
'
,
(
message
)
=>
{
if
(
message
.
type
===
'
title
'
)
{
terminalProcess
.
title
=
message
.
content
;
this
.
_onInstanceTitleChanged
.
fire
();
}
});
if
(
!
name
)
{
// Only listen for process title changes when a name is not provided
terminalProcess
.
process
.
on
(
'
message
'
,
(
message
)
=>
{
if
(
message
.
type
===
'
title
'
)
{
terminalProcess
.
title
=
message
.
content
;
this
.
_onInstanceTitleChanged
.
fire
();
}
});
}
return
terminalProcess
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录