12 ms·
I won't lie, I've used the original expect just because I needed to force a program to run in a pty. It turns out that script(1) will also do this though.
by aidenn0 4y ago
I won't lie, I've used the original expect just because I needed to force a program to run in a pty. It turns out that script(1) will also do this though.
- imurray 4y agoI 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...