Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
3a35fae7
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,发现更多精彩内容 >>
提交
3a35fae7
编写于
2月 05, 2020
作者:
D
Daniel Imms
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove browser/terminalNativeService
Fixes #81988
上级
6fb482dc
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
17 addition
and
45 deletion
+17
-45
src/vs/workbench/contrib/terminal/browser/terminalNativeService.ts
...rkbench/contrib/terminal/browser/terminalNativeService.ts
+0
-34
src/vs/workbench/contrib/terminal/browser/terminalService.ts
src/vs/workbench/contrib/terminal/browser/terminalService.ts
+17
-10
src/vs/workbench/workbench.web.main.ts
src/vs/workbench/workbench.web.main.ts
+0
-1
未找到文件。
src/vs/workbench/contrib/terminal/browser/terminalNativeService.ts
已删除
100644 → 0
浏览文件 @
6fb482dc
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
IOpenFileRequest
}
from
'
vs/platform/windows/common/windows
'
;
import
{
ITerminalNativeService
,
LinuxDistro
}
from
'
vs/workbench/contrib/terminal/common/terminal
'
;
import
{
Emitter
,
Event
}
from
'
vs/base/common/event
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
export
class
TerminalNativeService
implements
ITerminalNativeService
{
public
_serviceBrand
:
undefined
;
public
get
linuxDistro
():
LinuxDistro
{
return
LinuxDistro
.
Unknown
;
}
private
readonly
_onOpenFileRequest
=
new
Emitter
<
IOpenFileRequest
>
();
public
get
onOpenFileRequest
():
Event
<
IOpenFileRequest
>
{
return
this
.
_onOpenFileRequest
.
event
;
}
private
readonly
_onOsResume
=
new
Emitter
<
void
>
();
public
get
onOsResume
():
Event
<
void
>
{
return
this
.
_onOsResume
.
event
;
}
public
whenFileDeleted
():
Promise
<
void
>
{
throw
new
Error
(
'
Not implemented
'
);
}
public
getWslPath
():
Promise
<
string
>
{
throw
new
Error
(
'
Not implemented
'
);
}
public
getWindowsBuildNumber
():
number
{
throw
new
Error
(
'
Not implemented
'
);
}
}
registerSingleton
(
ITerminalNativeService
,
TerminalNativeService
,
true
);
src/vs/workbench/contrib/terminal/browser/terminalService.ts
浏览文件 @
3a35fae7
...
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
*
as
nls
from
'
vs/nls
'
;
import
{
TERMINAL_PANEL_ID
,
IShellLaunchConfig
,
ITerminalConfigHelper
,
ITerminalNativeService
,
ISpawnExtHostProcessRequest
,
IStartExtensionTerminalRequest
,
IAvailableShellsRequest
,
KEYBINDING_CONTEXT_TERMINAL_FOCUS
,
KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_VISIBLE
,
KEYBINDING_CONTEXT_TERMINAL_IS_OPEN
,
ITerminalProcessExtHostProxy
,
IShellDefinition
}
from
'
vs/workbench/contrib/terminal/common/terminal
'
;
import
{
TERMINAL_PANEL_ID
,
IShellLaunchConfig
,
ITerminalConfigHelper
,
ITerminalNativeService
,
ISpawnExtHostProcessRequest
,
IStartExtensionTerminalRequest
,
IAvailableShellsRequest
,
KEYBINDING_CONTEXT_TERMINAL_FOCUS
,
KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_VISIBLE
,
KEYBINDING_CONTEXT_TERMINAL_IS_OPEN
,
ITerminalProcessExtHostProxy
,
IShellDefinition
,
LinuxDistro
}
from
'
vs/workbench/contrib/terminal/common/terminal
'
;
import
{
IContextKeyService
,
IContextKey
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
IPanelService
}
from
'
vs/workbench/services/panel/common/panelService
'
;
import
{
IWorkbenchLayoutService
}
from
'
vs/workbench/services/layout/browser/layoutService
'
;
...
...
@@ -12,7 +12,7 @@ import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle';
import
{
TerminalPanel
}
from
'
vs/workbench/contrib/terminal/browser/terminalPanel
'
;
import
{
IDialogService
}
from
'
vs/platform/dialogs/common/dialogs
'
;
import
{
TerminalTab
}
from
'
vs/workbench/contrib/terminal/browser/terminalTab
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IInstantiationService
,
optional
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IExtensionService
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
import
{
IFileService
}
from
'
vs/platform/files/common/files
'
;
import
{
TerminalInstance
}
from
'
vs/workbench/contrib/terminal/browser/terminalInstance
'
;
...
...
@@ -86,6 +86,8 @@ export class TerminalService implements ITerminalService {
protected
readonly
_onRequestAvailableShells
=
new
Emitter
<
IAvailableShellsRequest
>
();
public
get
onRequestAvailableShells
():
Event
<
IAvailableShellsRequest
>
{
return
this
.
_onRequestAvailableShells
.
event
;
}
private
readonly
_terminalNativeService
:
ITerminalNativeService
|
undefined
;
constructor
(
@
IContextKeyService
private
_contextKeyService
:
IContextKeyService
,
@
IPanelService
private
_panelService
:
IPanelService
,
...
...
@@ -96,20 +98,25 @@ export class TerminalService implements ITerminalService {
@
IExtensionService
private
_extensionService
:
IExtensionService
,
@
IFileService
private
_fileService
:
IFileService
,
@
IRemoteAgentService
private
_remoteAgentService
:
IRemoteAgentService
,
@
ITerminalNativeService
private
_terminalNativeService
:
ITerminalNativeService
,
@
IQuickInputService
private
_quickInputService
:
IQuickInputService
,
@
IConfigurationService
private
_configurationService
:
IConfigurationService
@
IConfigurationService
private
_configurationService
:
IConfigurationService
,
@
optional
(
ITerminalNativeService
)
terminalNativeService
:
ITerminalNativeService
)
{
// @optional could give undefined and properly typing it breaks service registration
this
.
_terminalNativeService
=
terminalNativeService
as
ITerminalNativeService
|
undefined
;
this
.
_activeTabIndex
=
0
;
this
.
_isShuttingDown
=
false
;
this
.
_findState
=
new
FindReplaceState
();
lifecycleService
.
onBeforeShutdown
(
event
=>
event
.
veto
(
this
.
_onBeforeShutdown
()));
lifecycleService
.
onShutdown
(()
=>
this
.
_onShutdown
());
this
.
_terminalNativeService
.
onOpenFileRequest
(
e
=>
this
.
_onOpenFileRequest
(
e
));
this
.
_terminalNativeService
.
onOsResume
(()
=>
this
.
_onOsResume
());
if
(
this
.
_terminalNativeService
)
{
this
.
_terminalNativeService
.
onOpenFileRequest
(
e
=>
this
.
_onOpenFileRequest
(
e
));
this
.
_terminalNativeService
.
onOsResume
(()
=>
this
.
_onOsResume
());
}
this
.
_terminalFocusContextKey
=
KEYBINDING_CONTEXT_TERMINAL_FOCUS
.
bindTo
(
this
.
_contextKeyService
);
this
.
_findWidgetVisible
=
KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_VISIBLE
.
bindTo
(
this
.
_contextKeyService
);
this
.
_configHelper
=
this
.
_instantiationService
.
createInstance
(
TerminalConfigHelper
,
this
.
_terminalNativeService
.
linuxDistro
);
this
.
_configHelper
=
this
.
_instantiationService
.
createInstance
(
TerminalConfigHelper
,
this
.
_terminalNativeService
?.
linuxDistro
||
LinuxDistro
.
Unknown
);
this
.
onTabDisposed
(
tab
=>
this
.
_removeTab
(
tab
));
this
.
onActiveTabChanged
(()
=>
{
const
instance
=
this
.
getActiveInstance
();
...
...
@@ -201,7 +208,7 @@ export class TerminalService implements ITerminalService {
// marker file to get deleted and then focus back to the integrated terminal.
if
(
request
.
termProgram
===
'
vscode
'
&&
request
.
filesToWait
)
{
const
waitMarkerFileUri
=
URI
.
revive
(
request
.
filesToWait
.
waitMarkerFileUri
);
this
.
_terminalNativeService
.
whenFileDeleted
(
waitMarkerFileUri
).
then
(()
=>
{
this
.
_terminalNativeService
?
.
whenFileDeleted
(
waitMarkerFileUri
).
then
(()
=>
{
if
(
this
.
terminalInstances
.
length
>
0
)
{
const
terminal
=
this
.
getActiveInstance
();
if
(
terminal
)
{
...
...
@@ -533,7 +540,7 @@ export class TerminalService implements ITerminalService {
return
;
}
else
if
(
shellType
===
WindowsShellType
.
Wsl
)
{
if
(
this
.
_terminalNativeService
.
getWindowsBuildNumber
()
>=
17063
)
{
if
(
this
.
_terminalNativeService
&&
this
.
_terminalNativeService
.
getWindowsBuildNumber
()
>=
17063
)
{
c
(
this
.
_terminalNativeService
.
getWslPath
(
originalPath
));
}
else
{
c
(
originalPath
.
replace
(
/
\\
/g
,
'
/
'
));
...
...
@@ -548,7 +555,7 @@ export class TerminalService implements ITerminalService {
}
}
else
{
const
lowerExecutable
=
executable
.
toLowerCase
();
if
(
this
.
_terminalNativeService
.
getWindowsBuildNumber
()
>=
17063
&&
if
(
this
.
_terminalNativeService
&&
this
.
_terminalNativeService
.
getWindowsBuildNumber
()
>=
17063
&&
(
lowerExecutable
.
indexOf
(
'
wsl
'
)
!==
-
1
||
(
lowerExecutable
.
indexOf
(
'
bash.exe
'
)
!==
-
1
&&
lowerExecutable
.
toLowerCase
().
indexOf
(
'
git
'
)
===
-
1
)))
{
c
(
this
.
_terminalNativeService
.
getWslPath
(
originalPath
));
return
;
...
...
src/vs/workbench/workbench.web.main.ts
浏览文件 @
3a35fae7
...
...
@@ -108,7 +108,6 @@ import 'vs/workbench/contrib/webview/browser/webviewService';
import
'
vs/workbench/contrib/webview/browser/webviewWorkbenchService
'
;
// Terminal
import
'
vs/workbench/contrib/terminal/browser/terminalNativeService
'
;
import
'
vs/workbench/contrib/terminal/browser/terminalInstanceService
'
;
// Tasks
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录