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
17d2ee41
Commit
17d2ee41
authored
Dec 03, 2019
by
Medicean
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(Fix: Terminal) Fix #229
parent
9085af9f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
1 deletion
+25
-1
CHANGELOG.md
CHANGELOG.md
+4
-0
en.js
source/language/en.js
+1
-0
zh.js
source/language/zh.js
+1
-0
zh_hk.js
source/language/zh_hk.js
+1
-0
zh_tw.js
source/language/zh_tw.js
+1
-0
index.js
source/modules/terminal/index.js
+17
-1
No files found.
CHANGELOG.md
View file @
17d2ee41
...
...
@@ -52,6 +52,10 @@ Windows:
> 注意: asp 下设置之后, 当前机器上的IIS子进程都会受影响, 过一段时间子进程退出后正常
*
新增
`aswinmode`
本地指令, 在自动识别操作系统错误时, 可使用该指令手动切换命令行运行的模式 (#229 thx @nullnull1604-outlook)

### 其它
*
ACE 编辑器增加
`ace/mode/antswordjwt`
语法模式, 支持 JWT Token 语法高亮
...
...
source/language/en.js
View file @
17d2ee41
...
...
@@ -226,6 +226,7 @@ module.exports = {
ascmd [file]\t\tExecute the command with file, eg: ascmd /bin/bash
aslistcmd\t\tList available command interpreters
aspowershell [on|off]\t\tEnable/Disable PowerShell mode, eg: aspowershell on
aswinmode [on|off]\t\tEnable/Disable Windows mode(for recognition errors), eg: aswinmode on
quit\t\tClose terminal
exit\t\tClose terminal
...
...
source/language/zh.js
View file @
17d2ee41
...
...
@@ -226,6 +226,7 @@ module.exports = {
ascmd [file]\t\t指定file来执行命令, eg: ascmd /bin/bash
aslistcmd\t\t列出可使用的命令解释器
aspowershell [on|off]\t\t启用/关闭PowerShell模式, eg: aspowershell on
aswinmode [on|off]\t\t强制启用/关闭为Windows模式(针对识别出错的情况), eg: aswinmode on
quit\t\t关闭终端
exit\t\t关闭终端
...
...
source/language/zh_hk.js
View file @
17d2ee41
...
...
@@ -225,6 +225,7 @@ module.exports = {
ascmd [file]\t\t指定file來執行命令, eg: ascmd /bin/bash
aslistcmd\t\t列出可使用的命令解釋器
aspowershell [on|off]\t\t啟用/關閉PowerShell模式, eg: aspowershell on
aswinmode [on|off]\t\t強制啟用/關閉為Windows模式(針對識別出錯的情況), eg: aswinmode on
quit\t\t關閉終端
exit\t\t關閉終端
...
...
source/language/zh_tw.js
View file @
17d2ee41
...
...
@@ -225,6 +225,7 @@ module.exports = {
ascmd [file]\t\t指定file來執行命令, eg: ascmd /bin/bash
aslistcmd\t\t列出可使用的命令解釋器
aspowershell [on|off]\t\t啟用/關閉PowerShell模式, eg: aspowershell on
aswinmode [on|off]\t\t強制啟用/關閉為Windows模式(針對識別出錯的情況), eg: aswinmode on
quit\t\t關閉終端
exit\t\t關閉終端
...
...
source/modules/terminal/index.js
View file @
17d2ee41
...
...
@@ -275,6 +275,22 @@ class Terminal {
}
return
;
}
// 当 web 目录使用的是 smb 目录时, windows 下路径为 //xxx.xxx.xxx.xxx/share
// 第一个字符为 / 则会识别为 Linux 系统, 需要使用该指令手动切换成 windows mode
// Fix https://github.com/AntSwordProject/antSword/issues/229
if
(
cmd
.
substr
(
0
,
9
)
===
'aswinmode'
)
{
var
_switch
=
cmd
.
substr
(
9
).
trim
().
toLowerCase
();
if
(
_switch
===
"off"
)
{
self
.
isWin
=
false
;
term
.
echo
(
"Windows Mode: [[b;red;]Off]"
);
}
else
if
(
_switch
===
"on"
)
{
self
.
isWin
=
true
;
term
.
echo
(
"Windows Mode: [[b;green;]On]"
);
}
else
{
term
.
echo
(
`Current Windows Mode:
${
self
.
isWin
?
"[[b;green;]On]"
:
"[[b;red;]Off]"
}
`
);
}
return
;
}
if
(
cmd
.
substr
(
0
,
5
)
===
'asenv'
)
{
var
envstr
=
cmd
.
substr
(
5
).
trim
();
if
(
envstr
.
length
>
0
&&
envstr
.
indexOf
(
'='
)
>
0
)
{
...
...
@@ -382,7 +398,7 @@ class Terminal {
exit
:
false
,
// < 1.0.0 时使用3个参数 completion: (term, value, callback) => {}
completion
:
(
value
,
callback
)
=>
{
callback
([
'asenv'
,
'ashelp'
,
'ascmd'
,
'aslistcmd'
,
'aspowershell'
,
'quit'
,
'exit'
].
concat
(
callback
([
'asenv'
,
'ashelp'
,
'ascmd'
,
'aslistcmd'
,
'aspowershell'
,
'
aswinmode'
,
'
quit'
,
'exit'
].
concat
(
this
.
isWin
?
[
'dir'
,
'whoami'
,
'net'
,
'ipconfig'
,
'netstat'
,
'cls'
,
'wscript'
,
'nslookup'
,
'copy'
,
'del'
,
'ren'
,
'md'
,
'type'
,
'ping'
]
:
[
...
...
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