Sunday, April 19, 2020

Meta: reading file from stdin while still interacting with the terminal

I'm playing around with a curses program and would like it to behave
similarly to how vim lets me do

$ echo hello | vim -

where vim reads data from stdin but then interacts with the terminal
directrly. What magic is vim doing here?

For context, it's a dumb Python curses program, but if I try to pipe
data into it, it interprets the EOF on stdin and then complains
there's no input for the curses getch()/getkey() call.

It's not exactly vim-related other than "vim does what I want; what's
it doing under the hood?"

Thanks for any pointers you might send my way.

-tim


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200419220646.069dce75%40bigbox.attlocal.net.

No comments:

Post a Comment