Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
烟灰好
edex-ui
提交
d723b5fa
E
edex-ui
项目概览
烟灰好
/
edex-ui
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
edex-ui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
d723b5fa
编写于
11月 25, 2018
作者:
G
GitSquared
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
🐛
Fix fsDisp not following tabs & tab titles
上级
bc66a57d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
52 addition
and
12 deletion
+52
-12
src/_renderer.js
src/_renderer.js
+23
-0
src/classes/filesystem.class.js
src/classes/filesystem.class.js
+17
-12
src/classes/terminal.class.js
src/classes/terminal.class.js
+12
-0
未找到文件。
src/_renderer.js
浏览文件 @
d723b5fa
...
...
@@ -295,6 +295,9 @@ initGreeter = () => {
})
};
window
.
currentTerm
=
0
;
window
.
term
[
0
].
onprocesschange
=
p
=>
{
document
.
getElementById
(
"
shell_tab0
"
).
innerText
=
"
MAIN -
"
+
p
;
};
// Prevent losing hardware keyboard focus on the terminal when using touch keyboard
window
.
onmouseup
=
(
e
)
=>
{
window
.
term
[
window
.
currentTerm
].
term
.
focus
();
...
...
@@ -316,6 +319,14 @@ initGreeter = () => {
window
.
themeChanger
=
(
theme
)
=>
{
window
.
focusShellTab
(
0
);
for
(
let
i
=
1
;
i
<=
4
;
i
++
)
{
if
(
typeof
window
.
term
[
i
]
!==
undefined
)
{
window
.
term
[
i
].
socket
.
close
();
delete
window
.
term
[
i
];
document
.
getElementById
(
"
shell_tab
"
+
i
).
innerText
=
"
EMPTY
"
;
document
.
getElementById
(
"
terminal
"
+
i
).
innerHTML
=
""
;
}
}
let
src
=
path
.
join
(
themesDir
,
theme
+
"
.json
"
||
settings
.
theme
+
"
.json
"
);
// Always get fresh theme files
...
...
@@ -348,6 +359,11 @@ window.themeChanger = (theme) => {
})
};
window
.
currentTerm
=
0
;
window
.
term
[
0
].
onprocesschange
=
p
=>
{
document
.
getElementById
(
"
shell_tab0
"
).
innerText
=
"
MAIN -
"
+
p
;
};
initMods
();
window
.
fsDisp
=
new
FilesystemDisplay
({
parentId
:
"
filesystem
"
...
...
@@ -383,6 +399,8 @@ window.focusShellTab = (number) => {
window
.
term
[
number
].
fit
();
window
.
term
[
number
].
term
.
focus
();
window
.
term
[
number
].
resendCWD
();
window
.
fsDisp
.
followTab
();
}
else
if
(
number
>
0
&&
number
<=
4
&&
window
.
term
[
number
]
!==
null
)
{
window
.
term
[
number
]
=
null
;
...
...
@@ -401,12 +419,17 @@ window.focusShellTab = (number) => {
});
window
.
term
[
number
].
onclose
=
e
=>
{
delete
window
.
term
[
number
].
onprocesschange
;
document
.
getElementById
(
"
shell_tab
"
+
number
).
innerText
=
"
EMPTY
"
;
document
.
getElementById
(
"
terminal
"
+
number
).
innerHTML
=
""
;
delete
window
.
term
[
number
];
window
.
focusShellTab
(
0
);
};
window
.
term
[
number
].
onprocesschange
=
p
=>
{
document
.
getElementById
(
"
shell_tab
"
+
number
).
innerText
=
`#
${
number
}
-
${
p
}
`
;
};
document
.
getElementById
(
"
shell_tab
"
+
number
).
innerText
=
"
::
"
+
port
;
setTimeout
(()
=>
{
window
.
focusShellTab
(
number
);
...
...
src/classes/filesystem.class.js
浏览文件 @
d723b5fa
...
...
@@ -55,20 +55,25 @@ class FilesystemDisplay {
<h2 id="fs_disp_error">CANNOT ACCESS CURRENT WORKING DIRECTORY</h2>`
;
};
window
.
term
[
window
.
currentTerm
].
oncwdchange
=
(
cwd
)
=>
{
if
(
cwd
)
{
if
(
this
.
_fsWatcher
)
{
this
.
_fsWatcher
.
close
();
}
if
(
cwd
.
startsWith
(
"
FALLBACK |--
"
))
{
this
.
readFS
(
cwd
.
slice
(
13
));
this
.
_noTracking
=
true
;
}
else
{
this
.
readFS
(
cwd
);
this
.
watchFS
(
cwd
);
this
.
followTab
=
()
=>
{
let
num
=
window
.
currentTerm
;
window
.
term
[
num
].
oncwdchange
=
(
cwd
)
=>
{
if
(
cwd
&&
window
.
currentTerm
===
num
)
{
if
(
this
.
_fsWatcher
)
{
this
.
_fsWatcher
.
close
();
}
if
(
cwd
.
startsWith
(
"
FALLBACK |--
"
))
{
this
.
readFS
(
cwd
.
slice
(
13
));
this
.
_noTracking
=
true
;
}
else
{
this
.
readFS
(
cwd
);
this
.
watchFS
(
cwd
);
}
}
}
}
;
};
this
.
followTab
();
this
.
watchFS
=
(
dir
)
=>
{
if
(
this
.
_fsWatcher
)
{
...
...
src/classes/terminal.class.js
浏览文件 @
d723b5fa
...
...
@@ -85,6 +85,11 @@ class Terminal {
this
.
cwd
=
"
FALLBACK |--
"
+
args
[
1
];
this
.
oncwdchange
(
this
.
cwd
);
break
;
case
"
New process
"
:
if
(
this
.
onprocesschange
)
{
this
.
onprocesschange
(
args
[
1
]);
}
break
;
default
:
return
;
}
...
...
@@ -239,6 +244,7 @@ class Terminal {
});
};
this
.
_nextTickUpdateTtyCWD
=
false
;
this
.
_nextTickUpdateProcess
=
false
;
this
.
_tick
=
setInterval
(()
=>
{
if
(
this
.
_nextTickUpdateTtyCWD
&&
this
.
_disableCWDtracking
===
false
)
{
this
.
_nextTickUpdateTtyCWD
=
false
;
...
...
@@ -258,6 +264,11 @@ class Terminal {
}
});
}
if
(
this
.
renderer
&&
this
.
_nextTickUpdateProcess
)
{
this
.
renderer
.
send
(
"
terminal_channel-
"
+
this
.
port
,
"
New process
"
,
this
.
tty
.
_file
);
this
.
_nextTickUpdateProcess
=
false
;
}
},
1000
);
this
.
tty
=
this
.
Pty
.
spawn
(
opts
.
shell
||
"
bash
"
,
opts
.
params
||
[],
{
...
...
@@ -315,6 +326,7 @@ class Terminal {
});
this
.
tty
.
on
(
"
data
"
,
(
data
)
=>
{
this
.
_nextTickUpdateTtyCWD
=
true
;
this
.
_nextTickUpdateProcess
=
true
;
try
{
ws
.
send
(
data
);
}
catch
(
e
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录