X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;ds=sidebyside;f=mdp.c;fp=mdp.c;h=4e378796201b162c4caaf7a19a974844efb82ca5;hb=d1a7b3c065e6f6d4839cc6107284f3e715d6f7ab;hp=9a71cd0fd569c51362b8084c444957c4e2985353;hpb=ecc66f8a935eb4a3188b5336170182e34812fd40;p=smdp.git diff --git a/mdp.c b/mdp.c index 9a71cd0..4e37879 100644 --- a/mdp.c +++ b/mdp.c @@ -104,6 +104,10 @@ int main(int argc, char *argv[]) { // close file fclose(input); + // replace stdin with current tty if input was a pipe + if(input == stdin) + freopen("/dev/tty", "rw", stdin); + if(debug > 0) { markdown_debug(deck, debug); }