X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=mdp.c;h=4e378796201b162c4caaf7a19a974844efb82ca5;hb=9ec92ee10208b9c6215fa0c231a6668efc447939;hp=9a71cd0fd569c51362b8084c444957c4e2985353;hpb=d4843ea375360f37e965709e73c0fbd68e302dca;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); }