From: Brian Warner Date: Fri, 1 Dec 2006 02:45:43 +0000 (-0700) Subject: add ctrl-U and ctrl-H handling to our form of Manhole X-Git-Tag: tahoe_v0.1.0-0-UNSTABLE~523 X-Git-Url: https://git.rkrishnan.org/CLI.txt?a=commitdiff_plain;h=4e5a6bf808cfdbb4f76f65a3158d630c37152c9a;p=tahoe-lafs%2Ftahoe-lafs.git add ctrl-U and ctrl-H handling to our form of Manhole --- diff --git a/allmydata/manhole.py b/allmydata/manhole.py index 1fbfd321..dfc7af3f 100644 --- a/allmydata/manhole.py +++ b/allmydata/manhole.py @@ -78,6 +78,16 @@ class AuthorizedKeysChecker(conchc.SSHPublicKeyDatabase): continue return 0 +class ModifiedColoredManhole(manhole.ColoredManhole): + def connectionMade(self): + manhole.ColoredManhole.connectionMade(self) + self.keyHandlers["\x08"] = self.handle_DELETE + self.keyHandlers["\x15"] = self.handle_KILLLINE + + def handle_KILLLINE(self): + self.handle_END() + for i in range(len(self.lineBuffer)): + self.handle_BACKSPACE() class _BaseManhole(service.MultiService): """This provides remote access to a python interpreter (a read/exec/print @@ -130,7 +140,7 @@ class _BaseManhole(service.MultiService): def makeProtocol(): namespace = makeNamespace() - p = insults.ServerProtocol(manhole.ColoredManhole, namespace) + p = insults.ServerProtocol(ModifiedColoredManhole, namespace) return p self.using_ssh = using_ssh