Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
b5d1c0b9
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,发现更多精彩内容 >>
提交
b5d1c0b9
编写于
9月 20, 2021
作者:
D
Daniel Imms
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Setup pty host debug target
上级
960d1a6a
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
46 addition
and
16 deletion
+46
-16
.vscode/launch.json
.vscode/launch.json
+9
-0
src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts
.../code/electron-browser/sharedProcess/sharedProcessMain.ts
+1
-0
src/vs/platform/environment/common/argv.ts
src/vs/platform/environment/common/argv.ts
+2
-0
src/vs/platform/environment/common/environmentService.ts
src/vs/platform/environment/common/environmentService.ts
+4
-0
src/vs/platform/environment/node/argv.ts
src/vs/platform/environment/node/argv.ts
+2
-0
src/vs/platform/terminal/node/ptyHostService.ts
src/vs/platform/terminal/node/ptyHostService.ts
+28
-16
未找到文件。
.vscode/launch.json
浏览文件 @
b5d1c0b9
...
...
@@ -47,6 +47,15 @@
"${workspaceFolder}/out/**/*.js"
]
},
{
"type"
:
"node"
,
"request"
:
"attach"
,
"name"
:
"Attach to Pty Host Process"
,
"port"
:
5877
,
"outFiles"
:
[
"${workspaceFolder}/out/**/*.js"
]
},
{
"type"
:
"node"
,
"request"
:
"attach"
,
...
...
src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts
浏览文件 @
b5d1c0b9
...
...
@@ -284,6 +284,7 @@ class SharedProcessMain extends Disposable {
scrollback
:
configurationService
.
getValue
<
number
>
(
TerminalSettingId
.
PersistentSessionScrollback
)
??
100
},
configurationService
,
environmentService
,
logService
,
telemetryService
)
...
...
src/vs/platform/environment/common/argv.ts
浏览文件 @
b5d1c0b9
...
...
@@ -49,6 +49,8 @@ export interface NativeParsedArgs {
debugRenderer
?:
boolean
;
// whether we expect a debugger (js-debug) to attach to the renderer, incl webviews+webworker
'
inspect-search
'
?:
string
;
'
inspect-brk-search
'
?:
string
;
'
inspect-ptyhost
'
?:
string
;
'
inspect-brk-ptyhost
'
?:
string
;
'
disable-extensions
'
?:
boolean
;
'
disable-extension
'
?:
string
[];
// undefined or array of 1 or more
'
list-extensions
'
?:
boolean
;
...
...
src/vs/platform/environment/common/environmentService.ts
浏览文件 @
b5d1c0b9
...
...
@@ -251,6 +251,10 @@ export function parseSearchPort(args: NativeParsedArgs, isBuild: boolean): IDebu
return
parseDebugPort
(
args
[
'
inspect-search
'
],
args
[
'
inspect-brk-search
'
],
5876
,
isBuild
);
}
export
function
parsePtyHostPort
(
args
:
NativeParsedArgs
,
isBuild
:
boolean
):
IDebugParams
{
return
parseDebugPort
(
args
[
'
inspect-ptyhost
'
],
args
[
'
inspect-brk-ptyhost
'
],
5877
,
isBuild
);
}
function
parseDebugPort
(
debugArg
:
string
|
undefined
,
debugBrkArg
:
string
|
undefined
,
defaultBuildPort
:
number
,
isBuild
:
boolean
,
debugId
?:
string
):
IExtensionHostDebugParams
{
const
portStr
=
debugBrkArg
||
debugArg
;
const
port
=
Number
(
portStr
)
||
(
!
isBuild
?
defaultBuildPort
:
null
);
...
...
src/vs/platform/environment/node/argv.ts
浏览文件 @
b5d1c0b9
...
...
@@ -88,6 +88,8 @@ export const OPTIONS: OptionDescriptions<Required<NativeParsedArgs>> = {
'
extensionTestsPath
'
:
{
type
:
'
string
'
},
'
debugId
'
:
{
type
:
'
string
'
},
'
debugRenderer
'
:
{
type
:
'
boolean
'
},
'
inspect-ptyhost
'
:
{
type
:
'
string
'
},
'
inspect-brk-ptyhost
'
:
{
type
:
'
string
'
},
'
inspect-search
'
:
{
type
:
'
string
'
,
deprecates
:
'
debugSearch
'
},
'
inspect-brk-search
'
:
{
type
:
'
string
'
,
deprecates
:
'
debugBrkSearch
'
},
'
export-default-configuration
'
:
{
type
:
'
string
'
},
...
...
src/vs/platform/terminal/node/ptyHostService.ts
浏览文件 @
b5d1c0b9
...
...
@@ -8,8 +8,10 @@ import { Disposable, toDisposable } from 'vs/base/common/lifecycle';
import
{
FileAccess
}
from
'
vs/base/common/network
'
;
import
{
IProcessEnvironment
,
isWindows
,
OperatingSystem
}
from
'
vs/base/common/platform
'
;
import
{
ProxyChannel
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
Client
}
from
'
vs/base/parts/ipc/node/ipc.cp
'
;
import
{
Client
,
IIPCOptions
}
from
'
vs/base/parts/ipc/node/ipc.cp
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IEnvironmentService
,
INativeEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
parsePtyHostPort
}
from
'
vs/platform/environment/common/environmentService
'
;
import
{
resolveShellEnv
}
from
'
vs/platform/environment/node/shellEnv
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
LogLevelChannelClient
}
from
'
vs/platform/log/common/logIpc
'
;
...
...
@@ -89,6 +91,7 @@ export class PtyHostService extends Disposable implements IPtyService {
constructor
(
private
readonly
_reconnectConstants
:
IReconnectConstants
,
@
IConfigurationService
private
readonly
_configurationService
:
IConfigurationService
,
@
IEnvironmentService
private
readonly
_environmentService
:
INativeEnvironmentService
,
@
ILogService
private
readonly
_logService
:
ILogService
,
@
ITelemetryService
private
readonly
_telemetryService
:
ITelemetryService
)
{
...
...
@@ -109,22 +112,31 @@ export class PtyHostService extends Disposable implements IPtyService {
}
private
_startPtyHost
():
[
Client
,
IPtyService
]
{
const
client
=
new
Client
(
FileAccess
.
asFileUri
(
'
bootstrap-fork
'
,
require
).
fsPath
,
{
serverName
:
'
Pty Host
'
,
args
:
[
'
--type=ptyHost
'
],
env
:
{
VSCODE_LAST_PTY_ID
:
lastPtyId
,
VSCODE_AMD_ENTRYPOINT
:
'
vs/platform/terminal/node/ptyHostMain
'
,
VSCODE_PIPE_LOGGING
:
'
true
'
,
VSCODE_VERBOSE_LOGGING
:
'
true
'
,
// transmit console logs from server to client,
VSCODE_RECONNECT_GRACE_TIME
:
this
.
_reconnectConstants
.
graceTime
,
VSCODE_RECONNECT_SHORT_GRACE_TIME
:
this
.
_reconnectConstants
.
shortGraceTime
,
VSCODE_RECONNECT_SCROLLBACK
:
this
.
_reconnectConstants
.
scrollback
}
const
opts
:
IIPCOptions
=
{
serverName
:
'
Pty Host
'
,
args
:
[
'
--type=ptyHost
'
],
env
:
{
VSCODE_LAST_PTY_ID
:
lastPtyId
,
VSCODE_AMD_ENTRYPOINT
:
'
vs/platform/terminal/node/ptyHostMain
'
,
VSCODE_PIPE_LOGGING
:
'
true
'
,
VSCODE_VERBOSE_LOGGING
:
'
true
'
,
// transmit console logs from server to client,
VSCODE_RECONNECT_GRACE_TIME
:
this
.
_reconnectConstants
.
graceTime
,
VSCODE_RECONNECT_SHORT_GRACE_TIME
:
this
.
_reconnectConstants
.
shortGraceTime
,
VSCODE_RECONNECT_SCROLLBACK
:
this
.
_reconnectConstants
.
scrollback
}
};
const
ptyHostDebug
=
parsePtyHostPort
(
this
.
_environmentService
.
args
,
this
.
_environmentService
.
isBuilt
);
console
.
log
(
'
ptyHostDebug
'
,
ptyHostDebug
.
port
,
ptyHostDebug
.
break
);
if
(
ptyHostDebug
)
{
if
(
ptyHostDebug
.
break
&&
ptyHostDebug
.
port
)
{
opts
.
debugBrk
=
ptyHostDebug
.
port
;
}
else
if
(
!
ptyHostDebug
.
break
&&
ptyHostDebug
.
port
)
{
opts
.
debug
=
ptyHostDebug
.
port
;
}
);
}
const
client
=
new
Client
(
FileAccess
.
asFileUri
(
'
bootstrap-fork
'
,
require
).
fsPath
,
opts
);
this
.
_onPtyHostStart
.
fire
();
// Setup heartbeat service and trigger a heartbeat immediately to reset the timeouts
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录