coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[feature request] fool-tty shared object or command line tool


From: Whonix
Subject: [feature request] fool-tty shared object or command line tool
Date: Wed, 01 Mar 2017 15:48:00 +0000

feature request:

fool-tty [application] - fools application into detecting being run
inside a tty

I am not a C coder, but at least a shared object looks easy to implement.

echo "int isatty(int fd) { return 1; }" | gcc -O2 -fpic -shared -ldl -o
"fool-tty.so" -xc -

usage:

LD_PRELOAD+=" fool-tty.so"

LD_PRELOAD="$LD_PRELOAD" apt-get "$@" 2>&1 | tee -a "$logfile"

use case:

1)
http://stackoverflow.com/questions/1401002/trick-an-application-into-thinking-its-stdin-is-interactive-not-a-pipe/26263980#26263980

python -c 'import pty, sys; pty.spawn(sys.argv[1:])' \
   | apt-get "$@" 2>&1 \
   | tee -a "$logfile"

2)
http://unix.stackexchange.com/questions/347970/how-to-create-a-real-copy-of-file-descriptor-stdout-and-stderr-without-using-unb

Could you ship such a command line tool or shared object for LD_PRELOAD
with core-utils please?

Best regards,
Patrick



reply via email to

[Prev in Thread] Current Thread [Next in Thread]