diff --git a/IPython/Extensions/ibrowse.py b/IPython/Extensions/ibrowse.py index 2d6af89..cae6bb9 100644 --- a/IPython/Extensions/ibrowse.py +++ b/IPython/Extensions/ibrowse.py @@ -468,7 +468,9 @@ class _CommandInput(object): curses.KEY_LEFT: "left", curses.KEY_RIGHT: "right", curses.KEY_HOME: "home", + 1: "home", curses.KEY_END: "end", + 5: "end", # FIXME: What's happening here? 8: "backspace", 127: "backspace", @@ -748,7 +750,9 @@ class ibrowse(ipipe.Display): curses.KEY_LEFT: "left", curses.KEY_RIGHT: "right", curses.KEY_HOME: "home", + 1: "home", curses.KEY_END: "end", + 5: "end", ord("<"): "prevattr", 0x1b: "prevattr", # SHIFT-TAB ord(">"): "nextattr", @@ -951,6 +955,8 @@ class ibrowse(ipipe.Display): } if keycode in specialsnames: return specialsnames[keycode] + elif 0x00 < keycode < 0x20: + return "CTRL-%s" % chr(keycode + 64) return repr(chr(keycode)) for name in dir(curses): if name.startswith("KEY_") and getattr(curses, name) == keycode: diff --git a/doc/ChangeLog b/doc/ChangeLog index 0074b20..a9d0bcd 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -3,8 +3,9 @@ * IPython/Extensions/ibrowse.py: Add two new commands to ibrowse: hideattr (mapped to "h") hides the attribute under the cursor. "unhiderattrs" (mapped to "H") reveals all hidden - attributes again. Remapped the help command to "?". - + attributes again. Remapped the help command to "?". Display + keycodes in the range 0x01-0x1F as CTRL-xx. Add CTRL-a and CTRL-e + as keys for the "home" and "end" commands. 2006-06-15 Ville Vainio