3 ms·
I used to use `unbuffer` which comes with expect, and might be what you used too. I now use the following hack, which works faster: Create isatty.so like this:
by imurray 4y ago
I used to use `unbuffer` which comes with expect, and might be what you used too. I now use the following hack, which works faster:
Create isatty.so like this:
echo "int isatty(int fd) { return 1; }" | gcc -O2 -fpic -shared -ldl -o isatty.so -xc -
Then to make `some_program` think it's in a tty:
LD_PRELOAD=./isatty.so some_programe
Source and more: https://unix.stackexchange.com/questions/249723/how-to-trick-a-command-into-thinking-its-output-is-going-to-a-terminal https://unix.stackexchange.com/questions/249723/how-to-trick...