From 4e5a6bf808cfdbb4f76f65a3158d630c37152c9a Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Thu, 30 Nov 2006 19:45:43 -0700 Subject: [PATCH] add ctrl-U and ctrl-H handling to our form of Manhole --- allmydata/manhole.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 -- 2.45.2