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
8a1c8973
Commit
8a1c8973
authored
Sep 15, 2017
by
Alexander Praetorius
Committed by
GitHub
Sep 15, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #13 from ethereum/fixHistory
fix history
parents
494187be
81bf4d02
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 @
8a1c8973
...
@@ -399,6 +399,7 @@ class Terminal {
...
@@ -399,6 +399,7 @@ class Terminal {
}
}
self
.
_cmdHistory
=
[]
self
.
_cmdHistory
=
[]
self
.
_cmdIndex
=
-
1
self
.
_cmdTemp
=
''
self
.
_cmdTemp
=
''
return
self
.
_view
.
el
return
self
.
_view
.
el
...
@@ -411,31 +412,34 @@ class Terminal {
...
@@ -411,31 +412,34 @@ class Terminal {
putCursor2End
(
self
.
_view
.
input
)
putCursor2End
(
self
.
_view
.
input
)
self
.
scroll2bottom
()
self
.
scroll2bottom
()
}
else
{
// <enter>
}
else
{
// <enter>
self
.
_cmdIndex
=
-
1
self
.
_cmdTemp
=
''
event
.
preventDefault
()
event
.
preventDefault
()
var
script
=
self
.
_view
.
input
.
innerText
.
trim
()
var
script
=
self
.
_view
.
input
.
innerText
.
trim
()
self
.
_view
.
input
.
innerText
=
'
\
n'
self
.
_view
.
input
.
innerText
=
'
\
n'
if
(
script
.
length
)
{
if
(
script
.
length
)
{
self
.
_cmdHistory
.
push
(
script
)
self
.
_cmdHistory
.
unshift
(
script
)
self
.
commands
.
script
(
script
)
self
.
commands
.
script
(
script
)
}
}
}
}
}
else
if
(
event
.
which
===
38
)
{
// <arrowUp>
}
else
if
(
event
.
which
===
38
)
{
// <arrowUp>
var
len
=
self
.
_cmdHistory
.
length
var
len
=
self
.
_cmdHistory
.
length
if
(
len
===
0
)
return
event
.
preventDefault
()
if
(
len
===
0
)
return
event
.
preventDefault
()
if
(
self
.
_cmdIndex
===
undefined
)
{
if
(
self
.
_cmdHistory
.
length
-
1
>
self
.
_cmdIndex
)
{
self
.
_cmdIndex
=
len
-
1
self
.
_cmdIndex
++
self
.
_cmdTemp
=
self
.
_view
.
input
.
innerText
}
}
else
if
(
self
.
_cmdIndex
===
0
)
return
else
self
.
_cmdIndex
-=
1
self
.
_view
.
input
.
innerText
=
self
.
_cmdHistory
[
self
.
_cmdIndex
]
self
.
_view
.
input
.
innerText
=
self
.
_cmdHistory
[
self
.
_cmdIndex
]
putCursor2End
(
self
.
_view
.
input
)
self
.
scroll2bottom
()
self
.
scroll2bottom
()
}
else
if
(
event
.
which
===
40
)
{
// <arrowDown>
}
else
if
(
event
.
which
===
40
)
{
// <arrowDown>
if
(
self
.
_cmdIndex
===
undefined
)
return
if
(
self
.
_cmdIndex
>
-
1
)
{
else
if
(
self
.
_cmdIndex
===
self
.
_cmdHistory
.
length
-
1
)
self
.
_cmdIndex
=
undefined
self
.
_cmdIndex
--
else
self
.
_cmdIndex
+=
1
}
self
.
_view
.
input
.
innerText
=
self
.
_cmd
History
[
self
.
_cmdIndex
]
||
self
.
_cmdTemp
self
.
_view
.
input
.
innerText
=
self
.
_cmd
Index
>=
0
?
self
.
_cmdHistory
[
self
.
_cmdIndex
]
:
self
.
_cmdTemp
putCursor2End
(
self
.
_view
.
input
)
putCursor2End
(
self
.
_view
.
input
)
self
.
scroll2bottom
()
self
.
scroll2bottom
()
}
else
{
self
.
_cmdTemp
=
self
.
_view
.
input
.
innerText
}
}
}
}
function
putCursor2End
(
editable
)
{
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