* 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:
desaster 2009-11-25 17:10:55 +00:00
parent a3dd5c0d6e
commit 6b1120824a
1 changed files with 9 additions and 0 deletions

View File

@ -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' % \