Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
antSword
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HuangJunbo
antSword
Commits
b0256f69
Commit
b0256f69
authored
Mar 16, 2019
by
Medicean
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(Enhance:FileManager)新增「在此处打开终端」功能, 打开终端后快速跳到当前目录下
parent
733136c4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
4 deletions
+18
-4
CHANGELOG.md
CHANGELOG.md
+1
-0
en.js
source/language/en.js
+2
-1
zh.js
source/language/zh.js
+2
-1
files.js
source/modules/filemanager/files.js
+5
-1
index.js
source/modules/terminal/index.js
+8
-1
No files found.
CHANGELOG.md
View file @
b0256f69
...
...
@@ -32,6 +32,7 @@
### 文件管理
*
新增「在此处打开终端」功能, 打开终端后快速跳到当前目录下
*
新增「全局书签」功能, 可在「系统设置-默认设置」单击鼠标右键添加

...
...
source/language/en.js
View file @
b0256f69
...
...
@@ -348,7 +348,8 @@ module.exports = {
title
:
'Create'
,
folder
:
'Folder'
,
file
:
'File'
}
},
terminal
:
'Open Terminal Here'
}
}
},
...
...
source/language/zh.js
View file @
b0256f69
...
...
@@ -349,7 +349,8 @@ module.exports = {
title
:
'新建'
,
folder
:
'目录'
,
file
:
'文件'
}
},
terminal
:
'在此处打开终端'
}
}
},
...
...
source/modules/filemanager/files.js
View file @
b0256f69
...
...
@@ -5,6 +5,7 @@
const
LANG_T
=
antSword
[
'language'
][
'toastr'
];
const
LANG
=
antSword
[
'language'
][
'filemanager'
][
'files'
];
const
clipboard
=
require
(
'electron'
).
clipboard
;
const
Terminal
=
require
(
'../terminal/'
);
class
Files
{
...
...
@@ -372,7 +373,10 @@ class Files {
{
text
:
LANG
[
'grid'
][
'contextmenu'
][
'create'
][
'title'
],
icon
:
'fa fa-plus-circle'
,
subMenu
:
[
{
text
:
LANG
[
'grid'
][
'contextmenu'
][
'create'
][
'folder'
],
icon
:
'fa fa-folder-o'
,
action
:
manager
.
createFolder
.
bind
(
manager
)
},
{
text
:
LANG
[
'grid'
][
'contextmenu'
][
'create'
][
'file'
],
icon
:
'fa fa-file-o'
,
action
:
manager
.
createFile
.
bind
(
manager
)
}
]
}
]
},
{
text
:
LANG
[
'grid'
][
'contextmenu'
][
'terminal'
],
icon
:
'fa fa-terminal'
,
action
:
()
=>
{
new
Terminal
(
self
.
manager
.
opts
,
{
'path'
:
self
.
manager
.
path
});
}}
];
bmenu
(
menu
,
event
);
...
...
source/modules/terminal/index.js
View file @
b0256f69
...
...
@@ -9,7 +9,7 @@ const LANG_T = antSword['language']['toastr'];
class
Terminal
{
constructor
(
opts
)
{
constructor
(
opts
,
options
=
{}
)
{
// 生存一个随机ID,用于标识多个窗口dom
const
hash
=
String
(
Math
.
random
()).
substr
(
2
,
10
);
...
...
@@ -35,6 +35,7 @@ class Terminal {
this
.
path
=
''
;
this
.
opts
=
opts
;
this
.
options
=
options
||
{};
this
.
hash
=
hash
;
this
.
term
=
null
;
this
.
cell
=
cell
;
...
...
@@ -47,6 +48,12 @@ class Terminal {
.
getInformation
()
.
then
((
ret
)
=>
{
this
.
initTerminal
(
ret
[
'info'
],
ret
[
'dom'
]);
if
(
this
.
options
.
hasOwnProperty
(
"path"
))
{
if
(
this
.
isWin
&&
this
.
path
.
substr
(
0
,
1
).
toUpperCase
()
!=
this
.
options
.
path
.
substr
(
0
,
1
).
toUpperCase
())
{
this
.
term
.
exec
(
`
${
this
.
options
.
path
.
substr
(
0
,
1
).
toUpperCase
()}
:`
);
}
this
.
term
.
exec
(
`cd
${
this
.
options
.
path
}
`
);
}
})
.
catch
((
err
)
=>
{
toastr
.
error
((
typeof
(
err
)
===
'object'
)
?
JSON
.
stringify
(
err
)
:
String
(
err
),
LANG_T
[
'error'
]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment