Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
786663bb
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,发现更多精彩内容 >>
未验证
提交
786663bb
编写于
12月 14, 2021
作者:
M
Megan Rogge
提交者:
GitHub
12月 14, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
re-enable smoke tests, keep editor fix (#139012) (#139019) (#139115)
上级
fe719cd3
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
23 addition
and
17 deletion
+23
-17
src/vs/workbench/contrib/terminal/browser/terminalInstance.ts
...vs/workbench/contrib/terminal/browser/terminalInstance.ts
+4
-3
src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts
...workbench/contrib/terminal/browser/xterm/xtermTerminal.ts
+15
-10
src/vs/workbench/contrib/terminal/test/browser/xterm/xtermTerminal.test.ts
...contrib/terminal/test/browser/xterm/xtermTerminal.test.ts
+3
-3
test/smoke/src/areas/terminal/terminal-profiles.test.ts
test/smoke/src/areas/terminal/terminal-profiles.test.ts
+1
-1
未找到文件。
src/vs/workbench/contrib/terminal/browser/terminalInstance.ts
浏览文件 @
786663bb
...
...
@@ -179,12 +179,14 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
private
_labelComputer
?:
TerminalLabelComputer
;
private
_userHome
?:
string
;
private
_hasScrollBar
?:
boolean
;
private
_target
?:
TerminalLocation
|
undefined
;
get
target
():
TerminalLocation
|
undefined
{
return
this
.
xterm
?.
target
;
}
get
target
():
TerminalLocation
|
undefined
{
return
this
.
_
target
;
}
set
target
(
value
:
TerminalLocation
|
undefined
)
{
if
(
this
.
xterm
)
{
this
.
xterm
.
target
=
value
;
}
this
.
_target
=
value
;
}
get
instanceId
():
number
{
return
this
.
_instanceId
;
}
...
...
@@ -559,7 +561,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
throw
new
Error
(
'
Terminal disposed of during xterm.js creation
'
);
}
const
xterm
=
this
.
_instantiationService
.
createInstance
(
XtermTerminal
,
Terminal
,
this
.
_configHelper
,
this
.
_cols
,
this
.
_rows
);
const
xterm
=
this
.
_instantiationService
.
createInstance
(
XtermTerminal
,
Terminal
,
this
.
_configHelper
,
this
.
_cols
,
this
.
_rows
,
this
.
target
||
TerminalLocation
.
Panel
);
this
.
xterm
=
xterm
;
const
lineDataEventAddon
=
new
LineDataEventAddon
();
this
.
xterm
.
raw
.
loadAddon
(
lineDataEventAddon
);
...
...
@@ -701,7 +703,6 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
throw
new
Error
(
'
xterm elements not set after open
'
);
}
this
.
_setAriaLabel
(
xterm
.
raw
,
this
.
_instanceId
,
this
.
_title
);
xterm
.
raw
.
attachCustomKeyEventHandler
((
event
:
KeyboardEvent
):
boolean
=>
{
...
...
src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts
浏览文件 @
786663bb
...
...
@@ -13,13 +13,7 @@ import { TerminalConfigHelper } from 'vs/workbench/contrib/terminal/browser/term
import
{
DisposableStore
}
from
'
vs/base/common/lifecycle
'
;
import
{
IEditorOptions
}
from
'
vs/editor/common/config/editorOptions
'
;
import
{
TerminalLocation
,
TerminalSettingId
}
from
'
vs/platform/terminal/common/terminal
'
;
import
{
IColorTheme
,
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
IViewDescriptorService
,
ViewContainerLocation
}
from
'
vs/workbench/common/views
'
;
import
{
editorBackground
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
ansiColorIdentifiers
,
TERMINAL_BACKGROUND_COLOR
,
TERMINAL_CURSOR_BACKGROUND_COLOR
,
TERMINAL_CURSOR_FOREGROUND_COLOR
,
TERMINAL_FOREGROUND_COLOR
,
TERMINAL_SELECTION_BACKGROUND_COLOR
}
from
'
vs/workbench/contrib/terminal/common/terminalColorRegistry
'
;
import
{
ICommandTracker
,
ITerminalFont
,
TERMINAL_VIEW_ID
}
from
'
vs/workbench/contrib/terminal/common/terminal
'
;
import
{
PANEL_BACKGROUND
,
SIDE_BAR_BACKGROUND
}
from
'
vs/workbench/common/theme
'
;
import
{
Color
}
from
'
vs/base/common/color
'
;
import
{
isSafari
}
from
'
vs/base/browser/browser
'
;
import
{
IXtermTerminal
}
from
'
vs/workbench/contrib/terminal/browser/terminal
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
...
...
@@ -28,6 +22,12 @@ import { TerminalStorageKeys } from 'vs/workbench/contrib/terminal/common/termin
import
{
INotificationService
,
IPromptChoice
,
Severity
}
from
'
vs/platform/notification/common/notification
'
;
import
{
CommandTrackerAddon
}
from
'
vs/workbench/contrib/terminal/browser/xterm/commandTrackerAddon
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
IColorTheme
,
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
IViewDescriptorService
,
ViewContainerLocation
}
from
'
vs/workbench/common/views
'
;
import
{
editorBackground
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
PANEL_BACKGROUND
,
SIDE_BAR_BACKGROUND
}
from
'
vs/workbench/common/theme
'
;
import
{
TERMINAL_FOREGROUND_COLOR
,
TERMINAL_BACKGROUND_COLOR
,
TERMINAL_CURSOR_FOREGROUND_COLOR
,
TERMINAL_CURSOR_BACKGROUND_COLOR
,
TERMINAL_SELECTION_BACKGROUND_COLOR
,
ansiColorIdentifiers
}
from
'
vs/workbench/contrib/terminal/common/terminalColorRegistry
'
;
import
{
Color
}
from
'
vs/base/common/color
'
;
// How long in milliseconds should an average frame take to render for a notification to appear
// which suggests the fallback DOM-based renderer
...
...
@@ -45,7 +45,6 @@ let WebglAddon: typeof WebglAddonType;
export
class
XtermTerminal
extends
DisposableStore
implements
IXtermTerminal
{
/** The raw xterm.js instance */
readonly
raw
:
RawXtermTerminal
;
target
?:
TerminalLocation
;
private
_core
:
IXtermCore
;
private
static
_suggestedRendererType
:
'
canvas
'
|
'
dom
'
|
undefined
=
undefined
;
...
...
@@ -63,6 +62,12 @@ export class XtermTerminal extends DisposableStore implements IXtermTerminal {
get
commandTracker
():
ICommandTracker
{
return
this
.
_commandTrackerAddon
;
}
private
_target
:
TerminalLocation
|
undefined
;
set
target
(
location
:
TerminalLocation
|
undefined
)
{
this
.
_target
=
location
;
}
get
target
():
TerminalLocation
|
undefined
{
return
this
.
_target
;
}
/**
* @param xtermCtor The xterm.js constructor, this is passed in so it can be fetched lazily
* outside of this class such that {@link raw} is not nullable.
...
...
@@ -72,6 +77,7 @@ export class XtermTerminal extends DisposableStore implements IXtermTerminal {
private
readonly
_configHelper
:
TerminalConfigHelper
,
cols
:
number
,
rows
:
number
,
location
:
TerminalLocation
,
@
IConfigurationService
private
readonly
_configurationService
:
IConfigurationService
,
@
ILogService
private
readonly
_logService
:
ILogService
,
@
INotificationService
private
readonly
_notificationService
:
INotificationService
,
...
...
@@ -80,7 +86,7 @@ export class XtermTerminal extends DisposableStore implements IXtermTerminal {
@
IViewDescriptorService
private
readonly
_viewDescriptorService
:
IViewDescriptorService
)
{
super
();
this
.
target
=
location
;
const
font
=
this
.
_configHelper
.
getFont
(
undefined
,
true
);
const
config
=
this
.
_configHelper
.
config
;
const
editorOptions
=
this
.
_configurationService
.
getValue
<
IEditorOptions
>
(
'
editor
'
);
...
...
@@ -125,6 +131,7 @@ export class XtermTerminal extends DisposableStore implements IXtermTerminal {
this
.
_updateUnicodeVersion
();
}
}));
this
.
add
(
this
.
_themeService
.
onDidColorThemeChange
(
theme
=>
this
.
_updateTheme
(
theme
)));
this
.
add
(
this
.
_viewDescriptorService
.
onDidChangeLocation
(({
views
})
=>
{
if
(
views
.
some
(
v
=>
v
.
id
===
TERMINAL_VIEW_ID
))
{
...
...
@@ -133,7 +140,6 @@ export class XtermTerminal extends DisposableStore implements IXtermTerminal {
}));
// Load addons
this
.
_updateUnicodeVersion
();
this
.
_commandTrackerAddon
=
new
CommandTrackerAddon
();
...
...
@@ -148,7 +154,6 @@ export class XtermTerminal extends DisposableStore implements IXtermTerminal {
attachToElement
(
container
:
HTMLElement
)
{
// Update the theme when attaching as the terminal location could have changed
this
.
_updateTheme
();
if
(
!
this
.
_container
)
{
this
.
raw
.
open
(
container
);
}
...
...
src/vs/workbench/contrib/terminal/test/browser/xterm/xtermTerminal.test.ts
浏览文件 @
786663bb
...
...
@@ -109,7 +109,7 @@ suite('XtermTerminal', () => {
instantiationService
.
stub
(
IViewDescriptorService
,
viewDescriptorService
);
configHelper
=
instantiationService
.
createInstance
(
TerminalConfigHelper
);
xterm
=
instantiationService
.
createInstance
(
TestXtermTerminal
,
Terminal
,
configHelper
,
80
,
30
);
xterm
=
instantiationService
.
createInstance
(
TestXtermTerminal
,
Terminal
,
configHelper
,
80
,
30
,
1
);
TestWebglAddon
.
shouldThrow
=
false
;
TestWebglAddon
.
isEnabled
=
false
;
...
...
@@ -126,7 +126,7 @@ suite('XtermTerminal', () => {
[
PANEL_BACKGROUND
]:
'
#ff0000
'
,
[
SIDE_BAR_BACKGROUND
]:
'
#00ff00
'
}));
xterm
=
instantiationService
.
createInstance
(
XtermTerminal
,
Terminal
,
configHelper
,
80
,
30
);
xterm
=
instantiationService
.
createInstance
(
XtermTerminal
,
Terminal
,
configHelper
,
80
,
30
,
1
);
strictEqual
(
xterm
.
raw
.
getOption
(
'
theme
'
).
background
,
'
#ff0000
'
);
viewDescriptorService
.
moveTerminalToLocation
(
ViewContainerLocation
.
Sidebar
);
strictEqual
(
xterm
.
raw
.
getOption
(
'
theme
'
).
background
,
'
#00ff00
'
);
...
...
@@ -159,7 +159,7 @@ suite('XtermTerminal', () => {
'
terminal.ansiBrightCyan
'
:
'
#150000
'
,
'
terminal.ansiBrightWhite
'
:
'
#160000
'
,
}));
xterm
=
instantiationService
.
createInstance
(
XtermTerminal
,
Terminal
,
configHelper
,
80
,
30
);
xterm
=
instantiationService
.
createInstance
(
XtermTerminal
,
Terminal
,
configHelper
,
80
,
30
,
1
);
deepStrictEqual
(
xterm
.
raw
.
getOption
(
'
theme
'
),
{
background
:
'
#000100
'
,
foreground
:
'
#000200
'
,
...
...
test/smoke/src/areas/terminal/terminal-profiles.test.ts
浏览文件 @
786663bb
...
...
@@ -36,7 +36,7 @@ export function setup(opts: ParsedArgs) {
await
terminal
.
assertTerminalGroups
([[{
name
:
CONTRIBUTED_PROFILE_NAME
},
{
name
:
CONTRIBUTED_PROFILE_NAME
}]]);
});
it
.
skip
(
'
should set the default profile
'
,
async
()
=>
{
it
(
'
should set the default profile
'
,
async
()
=>
{
await
terminal
.
runCommandWithValue
(
TerminalCommandIdWithValue
.
SelectDefaultProfile
,
process
.
platform
===
'
win32
'
?
'
PowerShell
'
:
undefined
);
await
terminal
.
runCommand
(
TerminalCommandId
.
CreateNew
);
await
terminal
.
assertSingleTab
({
name
:
ANY_PROFILE_NAME
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录