Reading from stdin first, then use curses


Timo Schmiade

Hi all,

I wrote a replacement for urlview to properly extract URLs from emails.
You can find the first draft here:

When I call it with an email file passed to the '-f' argument, it does
pretty much what I want already. However, I intend to use it in mutt,
which pipes the message to the program like so:

macro pager \cu <pipe-entry>''<enter> 'Follow links with pyurlview'

The problem is rather obvious but - unfortunately - not so easy to solve:

* The program reads the mail from stdin
* The terminal in which it runs is a pseudo-terminal (pipe)
* curses is not able to accept user input from the pseudo-terminal

The question is:

How do I read from stdin first and afterwards allow curses to read user

Thanks in advance and kind regards,



Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question