From 11204242558d06997163a29180496753a5943af0 Mon Sep 17 00:00:00 2001 From: Erik Osheim Date: Tue, 9 Jun 2009 01:50:43 -0400 Subject: [PATCH] --pipe seems to work now, thanks to /dev/tty --HG-- branch : pmacs2 --- application.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/application.py b/application.py index c48d367..6da4890 100755 --- a/application.py +++ b/application.py @@ -1112,8 +1112,13 @@ if __name__ == "__main__": # if we used a pipe to read some data, that will be our first buffer if opts.pipe: - raise Exception("--pipe doesn't work yet") data = sys.stdin.read() + # since we just read until EOF from stdin, we need to reset STDIN using + # the TTY. + tty = open('/dev/tty', 'r') + os.dup2(tty.fileno(), sys.stdin.fileno()) + + # ok, so now create the actual buffer b = buffer.data.DataBuffer('*Pipe*', data) b.open() buffers.append(b)