Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
81bf4d02
Commit
81bf4d02
authored
Sep 14, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix history
parent
494187be
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
terminal.js
src/app/panels/terminal.js
+14
-10
No files found.
src/app/panels/terminal.js
View file @
81bf4d02
...
...
@@ -399,6 +399,7 @@ class Terminal {
}
self
.
_cmdHistory
=
[]
self
.
_cmdIndex
=
-
1
self
.
_cmdTemp
=
''
return
self
.
_view
.
el
...
...
@@ -411,31 +412,34 @@ class Terminal {
putCursor2End
(
self
.
_view
.
input
)
self
.
scroll2bottom
()
}
else
{
// <enter>
self
.
_cmdIndex
=
-
1
self
.
_cmdTemp
=
''
event
.
preventDefault
()
var
script
=
self
.
_view
.
input
.
innerText
.
trim
()
self
.
_view
.
input
.
innerText
=
'
\
n'
if
(
script
.
length
)
{
self
.
_cmdHistory
.
push
(
script
)
self
.
_cmdHistory
.
unshift
(
script
)
self
.
commands
.
script
(
script
)
}
}
}
else
if
(
event
.
which
===
38
)
{
// <arrowUp>
var
len
=
self
.
_cmdHistory
.
length
if
(
len
===
0
)
return
event
.
preventDefault
()
if
(
self
.
_cmdIndex
===
undefined
)
{
self
.
_cmdIndex
=
len
-
1
self
.
_cmdTemp
=
self
.
_view
.
input
.
innerText
}
else
if
(
self
.
_cmdIndex
===
0
)
return
else
self
.
_cmdIndex
-=
1
if
(
self
.
_cmdHistory
.
length
-
1
>
self
.
_cmdIndex
)
{
self
.
_cmdIndex
++
}
self
.
_view
.
input
.
innerText
=
self
.
_cmdHistory
[
self
.
_cmdIndex
]
putCursor2End
(
self
.
_view
.
input
)
self
.
scroll2bottom
()
}
else
if
(
event
.
which
===
40
)
{
// <arrowDown>
if
(
self
.
_cmdIndex
===
undefined
)
return
else
if
(
self
.
_cmdIndex
===
self
.
_cmdHistory
.
length
-
1
)
self
.
_cmdIndex
=
undefined
else
self
.
_cmdIndex
+=
1
self
.
_view
.
input
.
innerText
=
self
.
_cmd
History
[
self
.
_cmdIndex
]
||
self
.
_cmdTemp
if
(
self
.
_cmdIndex
>
-
1
)
{
self
.
_cmdIndex
--
}
self
.
_view
.
input
.
innerText
=
self
.
_cmd
Index
>=
0
?
self
.
_cmdHistory
[
self
.
_cmdIndex
]
:
self
.
_cmdTemp
putCursor2End
(
self
.
_view
.
input
)
self
.
scroll2bottom
()
}
else
{
self
.
_cmdTemp
=
self
.
_view
.
input
.
innerText
}
}
function
putCursor2End
(
editable
)
{
...
...
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