Unverified Commit 61bae649 authored by BaiJiangJie's avatar BaiJiangJie Committed by GitHub

Merge pull request #258 from jumpserver/dev_bai

[Update] Telent连接,添加终端类型配置项(选项协商使用)
parents 3e4529a0 e5578a29
......@@ -377,6 +377,7 @@ defaults = {
'UPLOAD_FAILED_REPLAY_ON_START': True,
'REUSE_CONNECTION': True,
'FORCE_REMOVE_FOLDER': False,
'TELNET_TTYPE': 'XTERM-256COLOR',
}
......
......@@ -344,7 +344,8 @@ class TelnetConnection:
elif x == telnetlib.DO + telnetlib.TTYPE:
new_data_list.append(telnetlib.WILL + telnetlib.TTYPE)
elif x == telnetlib.SB + telnetlib.TTYPE + b'\x01':
new_data_list.append(telnetlib.SB + telnetlib.TTYPE + b'\x00' + b'XTERM-256COLOR')
terminal_type = bytes(config.TELNET_TTYPE, encoding='utf-8')
new_data_list.append(telnetlib.SB + telnetlib.TTYPE + b'\x00' + terminal_type)
elif telnetlib.DO in x:
new_data_list.append(x.replace(telnetlib.DO, telnetlib.WONT))
elif telnetlib.WILL in x:
......
......@@ -63,3 +63,6 @@ BOOTSTRAP_TOKEN: <PleasgeChangeSameWithJumpserver>
# 是否强制删除文件夹:(default false)
# FORCE_REMOVE_FOLDER: false
# Telnet连接协商使用的终端类型
# TELNET_TTYPE: XTERM-256COLOR
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment