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
80ffb9d7
Commit
80ffb9d7
authored
Dec 08, 2015
by
kelianchun_miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update connect.py
parent
bd2a3e61
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
connect.py
connect.py
+9
-1
No files found.
connect.py
View file @
80ffb9d7
...
@@ -438,15 +438,23 @@ class SshTty(Tty):
...
@@ -438,15 +438,23 @@ class SshTty(Tty):
"""
"""
# 发起ssh连接请求 Make a ssh connection
# 发起ssh连接请求 Make a ssh connection
ssh
=
self
.
get_connection
()
ssh
=
self
.
get_connection
()
transport
=
ssh
.
get_transport
()
transport
.
set_keepalive
(
30
)
transport
.
use_compression
(
True
)
# 获取连接的隧道并设置窗口大小 Make a channel and set windows size
# 获取连接的隧道并设置窗口大小 Make a channel and set windows size
global
channel
global
channel
win_size
=
self
.
get_win_size
()
win_size
=
self
.
get_win_size
()
self
.
channel
=
channel
=
ssh
.
invoke_shell
(
height
=
win_size
[
0
],
width
=
win_size
[
1
],
term
=
'xterm'
)
#self.channel = channel = ssh.invoke_shell(height=win_size[0], width=win_size[1], term='xterm')
self
.
channel
=
channel
=
transport
.
open_session
()
channel
.
get_pty
(
term
=
'xterm'
,
height
=
win_size
[
0
],
width
=
win_size
[
1
])
channel
.
invoke_shell
()
try
:
try
:
signal
.
signal
(
signal
.
SIGWINCH
,
self
.
set_win_size
)
signal
.
signal
(
signal
.
SIGWINCH
,
self
.
set_win_size
)
except
:
except
:
pass
pass
self
.
posix_shell
()
self
.
posix_shell
()
# Shutdown channel socket
# Shutdown channel socket
...
...
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