X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=mdp.c;h=4e378796201b162c4caaf7a19a974844efb82ca5;hb=9ec92ee10208b9c6215fa0c231a6668efc447939;hp=d641faaa449865a2363cd441e896a622756ca88f;hpb=11bf64f833379a70fc3f9b2adb365312810a26c2;p=smdp.git diff --git a/mdp.c b/mdp.c index d641faa..4e37879 100644 --- a/mdp.c +++ b/mdp.c @@ -1,5 +1,5 @@ /* - * mpd -- A command-line based markdown presentation tool. + * mdp -- A command-line based markdown presentation tool. * Copyright (C) 2014 Michael Goehler * * This program is free software: you can redistribute it and/or modify @@ -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); }