-
Notifications
You must be signed in to change notification settings - Fork 963
Closed
Labels
Status: cantfixSomething that cannot be changed in geventSomething that cannot be changed in gevent
Description
I am using gevent in mushroom (https://bitbucket.org/terreon/mushroom) and would like to provide an interactive console using the Python cmd module. Using the new gevent.moneky.patch_sys breaks the arrow keys.
[Update] Shorter example showing the behavior:
from gevent import monkey
monkey.patch_sys()
input()Example program making use of cli. Just start the application and try pressing theup- and down-arrow keys.
#!/usr/bin/env python2
import cmd
from gevent import monkey
class Cmd(cmd.Cmd):
def do_exit(self, args):
'''Exit the console.'''
return 'exit'
def do_EOF(self, args):
'''You can exit the console by typing Ctrl+D.'''
return 'EOF'
def do_ping(self, args):
'''Return "pong".'''
print 'pong'
if __name__ == '__main__':
monkey.patch_sys()
cmd = Cmd()
cmd.cmdloop()Expected behaviour: It should be possible to pick a previous command from the history by using the arrow keys.
Actual behavior: It outputs ^[[A and ^[[B.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Status: cantfixSomething that cannot be changed in geventSomething that cannot be changed in gevent