mirror of https://github.com/cowrie/cowrie.git
* ctrl-c should empty the line buffer
* don't add lines to history if within a command git-svn-id: https://kippo.googlecode.com/svn/trunk@78 951d7100-d841-11de-b865-b3884708a8e2
This commit is contained in:
parent
a3dd5c0d6e
commit
6b1120824a
|
@ -113,6 +113,8 @@ class HoneyPotShell(object):
|
|||
self.honeypot.terminal.write(prompt % attrs)
|
||||
|
||||
def ctrl_c(self):
|
||||
self.honeypot.lineBuffer = []
|
||||
self.honeypot.lineBufferIndex = 0
|
||||
self.honeypot.terminal.nextLine()
|
||||
self.showPrompt()
|
||||
|
||||
|
@ -188,6 +190,13 @@ class HoneyPotProtocol(recvline.HistoricRecvLine):
|
|||
self.terminal.write(data)
|
||||
self.terminal.nextLine()
|
||||
|
||||
def handle_RETURN(self):
|
||||
if len(self.cmdstack) == 1:
|
||||
if self.lineBuffer:
|
||||
self.historyLines.append(''.join(self.lineBuffer))
|
||||
self.historyPosition = len(self.historyLines)
|
||||
return recvline.RecvLine.handle_RETURN(self)
|
||||
|
||||
class LoggingServerProtocol(insults.ServerProtocol):
|
||||
def connectionMade(self):
|
||||
self.ttylog_file = '%s/tty/%s-%s.log' % \
|
||||
|
|
Loading…
Reference in New Issue