Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
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
ops
jumpserver
Commits
52d8825d
Commit
52d8825d
authored
Mar 23, 2016
by
liuzheng712
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复tmux等会重复出现命令的bug
parent
e743ae3d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
views.py
jlog/views.py
+6
-3
No files found.
jlog/views.py
View file @
52d8825d
...
...
@@ -174,13 +174,12 @@ class TermLogRecorder(object):
self
.
_stream
.
attach
(
self
.
_screen
)
def
_command
(
self
):
self
.
_commands
=
[]
for
i
in
self
.
_screen
.
display
:
if
i
.
strip
()
.
__len__
()
>
0
:
self
.
_commands
.
append
(
i
.
strip
())
if
not
i
.
strip
()
==
''
:
self
.
CMD
[
str
(
time
.
time
())]
=
self
.
_commands
[
-
1
]
self
.
_screen
.
reset
()
if
not
self
.
_commands
[
-
1
]
==
''
:
self
.
CMD
[
str
(
time
.
time
())]
=
self
.
_commands
[
-
1
]
def
write
(
self
,
msg
):
if
self
.
recoder
and
(
not
self
.
_in_vim
):
...
...
@@ -199,6 +198,10 @@ class TermLogRecorder(object):
self
.
_screen
.
reset
()
else
:
self
.
_command
()
print
"<<<<<<<<<<<<<<<<"
print
self
.
_commands
print
self
.
CMD
print
">>>>>>>>>>>>>>>>"
self
.
log
[
str
(
time
.
time
()
-
self
.
recoderStartTime
)]
=
msg
.
decode
(
'utf-8'
,
'replace'
)
def
show
(
self
):
...
...
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