Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
54f9bccc
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,发现更多精彩内容 >>
提交
54f9bccc
编写于
11月 25, 2019
作者:
D
Daniel Imms
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename command
上级
bb2b119d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
17 addition
and
23 deletion
+17
-23
src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts
...rkbench/contrib/terminal/browser/terminal.contribution.ts
+6
-6
src/vs/workbench/contrib/terminal/browser/terminalActions.ts
src/vs/workbench/contrib/terminal/browser/terminalActions.ts
+11
-17
未找到文件。
src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts
浏览文件 @
54f9bccc
...
...
@@ -20,7 +20,7 @@ import * as panel from 'vs/workbench/browser/panel';
import
{
getQuickNavigateHandler
}
from
'
vs/workbench/browser/parts/quickopen/quickopen
'
;
import
{
Extensions
as
QuickOpenExtensions
,
IQuickOpenRegistry
,
QuickOpenHandlerDescriptor
}
from
'
vs/workbench/browser/quickopen
'
;
import
{
Extensions
as
ActionExtensions
,
IWorkbenchActionRegistry
}
from
'
vs/workbench/common/actions
'
;
import
{
ClearSelectionTerminalAction
,
ClearTerminalAction
,
CopyTerminalSelectionAction
,
CreateNewInActiveWorkspaceTerminalAction
,
CreateNewTerminalAction
,
DeleteToLineStartTerminalAction
,
DeleteWordLeftTerminalAction
,
DeleteWordRightTerminalAction
,
FindNext
,
FindPrevious
,
FocusActiveTerminalAction
,
FocusNextPaneTerminalAction
,
FocusNextTerminalAction
,
FocusPreviousPaneTerminalAction
,
FocusPreviousTerminalAction
,
FocusTerminalFindWidgetAction
,
HideTerminalFindWidgetAction
,
KillTerminalAction
,
MoveToLineEndTerminalAction
,
MoveToLineStartTerminalAction
,
QuickOpenActionTermContributor
,
QuickOpenTermAction
,
RenameTerminalAction
,
ResizePaneDownTerminalAction
,
ResizePaneLeftTerminalAction
,
ResizePaneRightTerminalAction
,
ResizePaneUpTerminalAction
,
RunActiveFileInTerminalAction
,
RunSelectedTextInTerminalAction
,
ScrollDownPageTerminalAction
,
ScrollDownTerminalAction
,
ScrollToBottomTerminalAction
,
ScrollToNextCommandAction
,
ScrollToPreviousCommandAction
,
ScrollToTopTerminalAction
,
ScrollUpPageTerminalAction
,
ScrollUpTerminalAction
,
SelectAllTerminalAction
,
SelectDefaultShellWindowsTerminalAction
,
SelectToNextCommandAction
,
SelectToNextLineAction
,
SelectToPreviousCommandAction
,
SelectToPreviousLineAction
,
SendSequenceTerminalCommand
,
SplitInActiveWorkspaceTerminalAction
,
SplitTerminalAction
,
TerminalPasteAction
,
TERMINAL_PICKER_PREFIX
,
ToggleCaseSensitiveCommand
,
ToggleEscapeSequenceLoggingAction
,
ToggleRegexCommand
,
ToggleTerminalAction
,
ToggleWholeWordCommand
,
NavigationModeFocusPreviousTerminalAction
,
NavigationModeFocusNextTerminalAction
,
NavigationModeExitTerminalAction
,
ManageWorkspaceShellPermissionsTerminalCommand
,
CreateNewWithCwdTerminalCommand
,
Rename
Active
TerminalCommand
}
from
'
vs/workbench/contrib/terminal/browser/terminalActions
'
;
import
{
ClearSelectionTerminalAction
,
ClearTerminalAction
,
CopyTerminalSelectionAction
,
CreateNewInActiveWorkspaceTerminalAction
,
CreateNewTerminalAction
,
DeleteToLineStartTerminalAction
,
DeleteWordLeftTerminalAction
,
DeleteWordRightTerminalAction
,
FindNext
,
FindPrevious
,
FocusActiveTerminalAction
,
FocusNextPaneTerminalAction
,
FocusNextTerminalAction
,
FocusPreviousPaneTerminalAction
,
FocusPreviousTerminalAction
,
FocusTerminalFindWidgetAction
,
HideTerminalFindWidgetAction
,
KillTerminalAction
,
MoveToLineEndTerminalAction
,
MoveToLineStartTerminalAction
,
QuickOpenActionTermContributor
,
QuickOpenTermAction
,
RenameTerminalAction
,
ResizePaneDownTerminalAction
,
ResizePaneLeftTerminalAction
,
ResizePaneRightTerminalAction
,
ResizePaneUpTerminalAction
,
RunActiveFileInTerminalAction
,
RunSelectedTextInTerminalAction
,
ScrollDownPageTerminalAction
,
ScrollDownTerminalAction
,
ScrollToBottomTerminalAction
,
ScrollToNextCommandAction
,
ScrollToPreviousCommandAction
,
ScrollToTopTerminalAction
,
ScrollUpPageTerminalAction
,
ScrollUpTerminalAction
,
SelectAllTerminalAction
,
SelectDefaultShellWindowsTerminalAction
,
SelectToNextCommandAction
,
SelectToNextLineAction
,
SelectToPreviousCommandAction
,
SelectToPreviousLineAction
,
SendSequenceTerminalCommand
,
SplitInActiveWorkspaceTerminalAction
,
SplitTerminalAction
,
TerminalPasteAction
,
TERMINAL_PICKER_PREFIX
,
ToggleCaseSensitiveCommand
,
ToggleEscapeSequenceLoggingAction
,
ToggleRegexCommand
,
ToggleTerminalAction
,
ToggleWholeWordCommand
,
NavigationModeFocusPreviousTerminalAction
,
NavigationModeFocusNextTerminalAction
,
NavigationModeExitTerminalAction
,
ManageWorkspaceShellPermissionsTerminalCommand
,
CreateNewWithCwdTerminalCommand
,
Rename
WithArg
TerminalCommand
}
from
'
vs/workbench/contrib/terminal/browser/terminalActions
'
;
import
{
TerminalPanel
}
from
'
vs/workbench/contrib/terminal/browser/terminalPanel
'
;
import
{
TerminalPickerHandler
}
from
'
vs/workbench/contrib/terminal/browser/terminalQuickOpen
'
;
import
{
KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_FOCUSED
,
KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_NOT_VISIBLE
,
KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_VISIBLE
,
KEYBINDING_CONTEXT_TERMINAL_FOCUS
,
KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED
,
TERMINAL_PANEL_ID
,
DEFAULT_LETTER_SPACING
,
DEFAULT_LINE_HEIGHT
,
TerminalCursorStyle
,
TERMINAL_ACTION_CATEGORY
,
KEYBINDING_CONTEXT_TERMINAL_A11Y_TREE_FOCUS
,
TERMINAL_COMMAND_ID
}
from
'
vs/workbench/contrib/terminal/common/terminal
'
;
...
...
@@ -612,19 +612,19 @@ if (BrowserFeatures.clipboard.readText) {
}
})).
register
();
(
new
Rename
Active
TerminalCommand
({
id
:
Rename
Active
TerminalCommand
.
ID
,
(
new
Rename
WithArg
TerminalCommand
({
id
:
Rename
WithArg
TerminalCommand
.
ID
,
precondition
:
undefined
,
description
:
{
description
:
Rename
Active
TerminalCommand
.
LABEL
,
description
:
Rename
WithArg
TerminalCommand
.
LABEL
,
args
:
[{
name
:
'
args
'
,
schema
:
{
type
:
'
object
'
,
required
:
[
'
n
ewN
ame
'
],
required
:
[
'
name
'
],
properties
:
{
newName
:
{
description
:
Rename
ActiveTerminalCommand
.
NEW_
NAME_ARG_LABEL
,
description
:
Rename
WithArgTerminalCommand
.
NAME_ARG_LABEL
,
type
:
'
string
'
,
minLength
:
1
}
...
...
src/vs/workbench/contrib/terminal/browser/terminalActions.ts
浏览文件 @
54f9bccc
...
...
@@ -1055,35 +1055,29 @@ export class RenameTerminalAction extends Action {
});
}
}
export
class
Rename
Active
TerminalCommand
extends
Command
{
export
class
Rename
WithArg
TerminalCommand
extends
Command
{
public
static
readonly
ID
=
TERMINAL_COMMAND_ID
.
RENAME_NONINTERACTIVE
;
public
static
readonly
LABEL
=
nls
.
localize
(
'
workbench.action.terminal.renameNoninteractive
'
,
'
Rename the Currently Active Terminal
'
);
public
static
readonly
NEW_NAME_ARG_LABEL
=
nls
.
localize
(
'
workbench.action.terminal.renameNoninteractive.newName
'
,
'
The new name for the terminal
'
);
public
static
readonly
LABEL
=
nls
.
localize
(
'
workbench.action.terminal.renameWithArg
'
,
"
Rename the Currently Active Terminal
"
);
public
static
readonly
NAME_ARG_LABEL
=
nls
.
localize
(
'
workbench.action.terminal.renameWithArg.name
'
,
"
The new name for the terminal
"
);
public
runCommand
(
accessor
:
ServicesAccessor
,
args
:
{
newName
:
string
;
}
args
?:
{
name
?:
string
}
):
void
{
const
notificationService
=
accessor
.
get
(
INotificationService
);
const
terminalInstance
=
accessor
.
get
(
ITerminalService
).
getActiveInstance
();
if
(
!
terminalInstance
)
{
notificationService
.
warn
(
nls
.
localize
(
RenameActiveTerminalCommand
.
LABEL
+
'
.noActiveTerminal
'
,
'
No active terminal to rename
'
));
notificationService
.
warn
(
nls
.
localize
(
'
workbench.action.terminal.renameWithArg.noTerminal
'
,
"
No active terminal to rename
"
));
return
;
}
if
(
!
args
||
!
args
.
name
)
{
notificationService
.
warn
(
nls
.
localize
(
'
workbench.action.terminal.renameWithArg.noName
'
,
"
No name argument provided
"
));
return
;
}
terminalInstance
.
setTitle
(
args
.
n
ewN
ame
,
TitleEventSource
.
Api
);
terminalInstance
.
setTitle
(
args
.
name
,
TitleEventSource
.
Api
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录