HACK: use /dev/tty instead of stdin for terminal in C stuff