Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
bae64c4d
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,体验更适合开发者的 AI 搜索 >>
提交
bae64c4d
编写于
5月 24, 2017
作者:
D
Daniel Imms
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fork terminalProcess using amd, convert to TS
Fixes #27182
上级
5f0e3247
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
30 addition
and
14 deletion
+30
-14
src/vs/workbench/buildfile.js
src/vs/workbench/buildfile.js
+3
-1
src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts
...bench/parts/terminal/electron-browser/terminalInstance.ts
+3
-2
src/vs/workbench/parts/terminal/node/terminalProcess.ts
src/vs/workbench/parts/terminal/node/terminalProcess.ts
+24
-11
未找到文件。
src/vs/workbench/buildfile.js
浏览文件 @
bae64c4d
...
...
@@ -25,7 +25,9 @@ exports.collectModules = function (excludes) {
createModuleDescription
(
'
vs/workbench/services/search/node/worker/searchWorkerApp
'
,
[]),
createModuleDescription
(
'
vs/workbench/services/files/node/watcher/unix/watcherApp
'
,
[]),
createModuleDescription
(
'
vs/workbench/node/extensionHostProcess
'
,
[])
createModuleDescription
(
'
vs/workbench/node/extensionHostProcess
'
,
[]),
createModuleDescription
(
'
vs/workbench/parts/terminal/node/terminalProcess
'
,
[])
];
return
modules
;
...
...
src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts
浏览文件 @
bae64c4d
...
...
@@ -473,8 +473,8 @@ export class TerminalInstance implements ITerminalInstance {
}
const
env
=
TerminalInstance
.
createTerminalEnv
(
process
.
env
,
shell
,
this
.
_getCwd
(
shell
,
workspace
),
locale
,
this
.
_cols
,
this
.
_rows
);
this
.
_title
=
shell
.
name
||
''
;
this
.
_process
=
cp
.
fork
(
'
../node/terminalProcess
'
,
[
],
{
env
:
env
,
this
.
_process
=
cp
.
fork
(
URI
.
parse
(
require
.
toUrl
(
'
bootstrap
'
)).
fsPath
,
[
'
--type=terminal
'
],
{
env
,
cwd
:
URI
.
parse
(
path
.
dirname
(
require
.
toUrl
(
'
../node/terminalProcess
'
))).
fsPath
});
if
(
!
shell
.
name
)
{
...
...
@@ -622,6 +622,7 @@ export class TerminalInstance implements ITerminalInstance {
env
[
'
PTYCOLS
'
]
=
cols
.
toString
();
env
[
'
PTYROWS
'
]
=
rows
.
toString
();
}
env
[
'
AMD_ENTRYPOINT
'
]
=
'
vs/workbench/parts/terminal/node/terminalProcess
'
;
return
env
;
}
...
...
src/vs/workbench/parts/terminal/node/terminalProcess.
j
s
→
src/vs/workbench/parts/terminal/node/terminalProcess.
t
s
浏览文件 @
bae64c4d
...
...
@@ -3,21 +3,23 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
var
fs
=
require
(
'
fs
'
);
var
os
=
require
(
'
os
'
);
var
path
=
require
(
'
path
'
);
var
ptyJs
=
require
(
'
node-pty
'
);
import
*
as
fs
from
'
fs
'
;
fs
.
writeFileSync
(
'
/home/daniel/testing-terminal-1
'
,
'
foo
'
);
import
*
as
os
from
'
os
'
;
import
*
as
path
from
'
path
'
;
import
*
as
ptyJs
from
'
node-pty
'
;
fs
.
writeFileSync
(
'
/home/daniel/testing-terminal-2
'
,
'
foo
'
);
// The pty process needs to be run in its own child process to get around maxing out CPU on Mac,
// see https://github.com/electron/electron/issues/38
var
name
;
var
shellName
:
string
;
if
(
os
.
platform
()
===
'
win32
'
)
{
n
ame
=
path
.
basename
(
process
.
env
.
PTYSHELL
);
shellN
ame
=
path
.
basename
(
process
.
env
.
PTYSHELL
);
}
else
{
// Using 'xterm-256color' here helps ensure that the majority of Linux distributions will use a
// color prompt as defined in the default ~/.bashrc file.
n
ame
=
'
xterm-256color
'
;
shellN
ame
=
'
xterm-256color
'
;
}
var
shell
=
process
.
env
.
PTYSHELL
;
var
args
=
getArgs
();
...
...
@@ -29,16 +31,26 @@ var currentTitle = '';
setupPlanB
(
process
.
env
.
PTYPID
);
cleanEnv
();
var
options
=
{
name
:
name
,
cwd
:
cwd
interface
IOptions
{
name
:
string
;
cwd
:
string
;
cols
?:
number
;
rows
?:
number
;
}
var
options
:
IOptions
=
{
name
:
shellName
,
cwd
};
if
(
cols
&&
rows
)
{
options
.
cols
=
parseInt
(
cols
,
10
);
options
.
rows
=
parseInt
(
rows
,
10
);
}
fs
.
writeFileSync
(
'
/home/daniel/testing-terminal-3
'
,
'
foo
'
);
var
ptyProcess
=
ptyJs
.
fork
(
shell
,
args
,
options
);
fs
.
writeFileSync
(
'
/home/daniel/testing-terminal-4
'
,
'
foo
'
);
var
closeTimeout
;
var
exitCode
;
...
...
@@ -93,6 +105,7 @@ function getArgs() {
function
cleanEnv
()
{
var
keys
=
[
'
AMD_ENTRYPOINT
'
,
'
ELECTRON_RUN_AS_NODE
'
,
'
PTYCWD
'
,
'
PTYPID
'
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录