mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-23 01:53:28 +00:00
Do not overwrite 'login' prompt in ssh plugin
ssh plugin was sending backspaces without bound, causing deletion of the login prompt.
This commit is contained in:
parent
00da61b981
commit
05e642ada5
@ -117,10 +117,12 @@ class SshShell(conapi.Console):
|
||||
|
||||
def write(self, data):
|
||||
if self.inputmode == 0:
|
||||
while len(data) > 0 and data[0] == b'\x7f':
|
||||
while len(data) and data[0] == b'\x7f' and len(self.username):
|
||||
self.datacallback('\b \b') # erase previously echoed value
|
||||
self.username = self.username[:-1]
|
||||
data = data[1:]
|
||||
while len(data) and data[0] == b'\x7f':
|
||||
data = data[1:]
|
||||
while b'\x7f' in data:
|
||||
delidx = data.index(b'\x7f')
|
||||
data = data[:delidx - 1] + data[delidx + 1:]
|
||||
|
Loading…
Reference in New Issue
Block a user