fix flush stdout in subprocess
chomp input line