I am trying to implement an interactive shell on top of the internal API that gevent uses. I want the background greens to continue to work while waiting for user input, and I also want to use the readline command line functions (history, line editing, etc.).
My problem is that raw_input is blocked. There are solutions around which to replace raw_input with things like:
def raw_input(prompt): sys.stdout.write(prompt) sys.stdout.flush() select.select([sys.stdin], [], []) return sys.stdin.readline().rstrip('\n')
This solves the lock problem; green backgrounds now work fine. But I'm losing interactive line editing features.
Any suggestions or workarounds?
source share