Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
0e7fc5fa
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,发现更多精彩内容 >>
未验证
提交
0e7fc5fa
编写于
4月 05, 2021
作者:
D
Daniel Imms
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add icon to launch config
Part of #120241
上级
17ae3eea
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
26 addition
and
3 deletion
+26
-3
src/vs/platform/terminal/common/terminal.ts
src/vs/platform/terminal/common/terminal.ts
+6
-0
src/vs/workbench/contrib/terminal/browser/terminal.ts
src/vs/workbench/contrib/terminal/browser/terminal.ts
+2
-0
src/vs/workbench/contrib/terminal/browser/terminalActions.ts
src/vs/workbench/contrib/terminal/browser/terminalActions.ts
+7
-1
src/vs/workbench/contrib/terminal/browser/terminalInstance.ts
...vs/workbench/contrib/terminal/browser/terminalInstance.ts
+2
-0
src/vs/workbench/contrib/terminal/browser/terminalService.ts
src/vs/workbench/contrib/terminal/browser/terminalService.ts
+7
-1
src/vs/workbench/contrib/terminal/browser/terminalTab.ts
src/vs/workbench/contrib/terminal/browser/terminalTab.ts
+1
-1
src/vs/workbench/contrib/terminal/common/terminal.ts
src/vs/workbench/contrib/terminal/common/terminal.ts
+1
-0
未找到文件。
src/vs/platform/terminal/common/terminal.ts
浏览文件 @
0e7fc5fa
...
...
@@ -281,6 +281,12 @@ export interface IShellLaunchConfig {
* Whether this terminal was created by an extension.
*/
isExtensionOwnedTerminal
?:
boolean
;
/**
* The codicon ID to use for this terminal. If not specified it will use the default fallback
* icon.
*/
iconId
?:
string
;
}
export
interface
IShellLaunchConfigDto
{
...
...
src/vs/workbench/contrib/terminal/browser/terminal.ts
浏览文件 @
0e7fc5fa
...
...
@@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
Codicon
}
from
'
vs/base/common/codicons
'
;
import
{
Event
}
from
'
vs/base/common/event
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IProcessEnvironment
,
Platform
}
from
'
vs/base/common/platform
'
;
...
...
@@ -244,6 +245,7 @@ export interface ITerminalInstance {
readonly
rows
:
number
;
readonly
maxCols
:
number
;
readonly
maxRows
:
number
;
readonly
icon
:
Codicon
;
/**
* The process ID of the shell process, this is undefined when there is no process associated
...
...
src/vs/workbench/contrib/terminal/browser/terminalActions.ts
浏览文件 @
0e7fc5fa
...
...
@@ -1517,7 +1517,13 @@ export function registerTerminalActions() {
if
(
launchConfig
)
{
const
workspaceShellAllowed
=
terminalService
.
configHelper
.
checkIsProcessLaunchSafe
(
undefined
,
launchConfig
);
if
(
workspaceShellAllowed
)
{
const
instance
=
terminalService
.
createTerminal
({
executable
:
launchConfig
.
path
,
args
:
launchConfig
.
args
,
name
:
launchConfig
.
overrideName
?
launchConfig
.
profileName
:
undefined
});
// TODO: Share profile launch with that in terminalService
const
instance
=
terminalService
.
createTerminal
({
executable
:
launchConfig
.
path
,
args
:
launchConfig
.
args
,
iconId
:
launchConfig
.
icon
,
name
:
launchConfig
.
overrideName
?
launchConfig
.
profileName
:
undefined
});
terminalService
.
setActiveInstance
(
instance
);
}
}
else
{
...
...
src/vs/workbench/contrib/terminal/browser/terminalInstance.ts
浏览文件 @
0e7fc5fa
...
...
@@ -51,6 +51,7 @@ import { IProcessDataEvent, IShellLaunchConfig, ITerminalDimensionsOverride, ITe
import
{
IProductService
}
from
'
vs/platform/product/common/productService
'
;
import
{
formatMessageForTerminal
}
from
'
vs/workbench/contrib/terminal/common/terminalStrings
'
;
import
{
AutoOpenBarrier
}
from
'
vs/base/common/async
'
;
import
{
Codicon
,
iconRegistry
}
from
'
vs/base/common/codicons
'
;
// How long in milliseconds should an average frame take to render for a notification to appear
// which suggests the fallback DOM-based renderer
...
...
@@ -169,6 +170,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
public
get
commandTracker
():
CommandTrackerAddon
|
undefined
{
return
this
.
_commandTrackerAddon
;
}
public
get
navigationMode
():
INavigationMode
|
undefined
{
return
this
.
_navigationModeAddon
;
}
public
get
isDisconnected
():
boolean
{
return
this
.
_processManager
.
isDisconnected
;
}
public
get
icon
():
Codicon
{
return
this
.
shellLaunchConfig
.
iconId
?
(
iconRegistry
.
get
(
this
.
shellLaunchConfig
.
iconId
)
||
Codicon
.
terminal
)
:
Codicon
.
terminal
;
}
private
readonly
_onExit
=
new
Emitter
<
number
|
undefined
>
();
public
get
onExit
():
Event
<
number
|
undefined
>
{
return
this
.
_onExit
.
event
;
}
...
...
src/vs/workbench/contrib/terminal/browser/terminalService.ts
浏览文件 @
0e7fc5fa
...
...
@@ -896,7 +896,13 @@ export class TerminalService implements ITerminalService {
return
;
}
if
(
type
===
'
createInstance
'
)
{
const
launchConfig
=
{
executable
:
value
.
profile
.
path
,
args
:
value
.
profile
.
args
,
name
:
value
.
profile
.
overrideName
?
value
.
profile
.
profileName
:
undefined
};
const
launchConfig
:
IShellLaunchConfig
=
{
executable
:
value
.
profile
.
path
,
args
:
value
.
profile
.
args
,
iconId
:
value
.
profile
.
icon
,
name
:
value
.
profile
.
overrideName
?
value
.
profile
.
profileName
:
undefined
};
let
instance
;
const
activeInstance
=
this
.
getActiveInstance
();
if
(
keyMods
?.
alt
&&
activeInstance
)
{
...
...
src/vs/workbench/contrib/terminal/browser/terminalTab.ts
浏览文件 @
0e7fc5fa
...
...
@@ -414,7 +414,7 @@ export class TerminalTab extends Disposable implements ITerminalTab {
}
private
_titleWithConnectionStatus
(
instance
:
ITerminalInstance
):
string
{
return
instance
.
isDisconnected
?
localize
(
'
ptyDisconnected
'
,
"
{0} (disconnected)
"
,
instance
.
title
)
:
instance
.
title
;
return
instance
.
isDisconnected
?
localize
(
'
ptyDisconnected
'
,
"
{0} (disconnected)
"
,
instance
.
title
)
:
`
${
instance
.
title
}
[
${
instance
.
icon
.
id
}
]`
;
}
public
setVisible
(
visible
:
boolean
):
void
{
...
...
src/vs/workbench/contrib/terminal/common/terminal.ts
浏览文件 @
0e7fc5fa
...
...
@@ -238,6 +238,7 @@ export interface ITerminalProfile {
isWorkspaceProfile
?:
boolean
;
args
?:
string
|
string
[]
|
undefined
;
overrideName
?:
boolean
;
icon
?:
string
;
}
export
const
enum
ProfileSource
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录