terminal-util: when querying bg color, ensure input fd and output fd refer to same tty
authorLennart Poettering <lennart@poettering.net>
Wed, 10 Jul 2024 15:18:55 +0000 (17:18 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 19 Jul 2024 09:41:43 +0000 (11:41 +0200)
commit445e57387e36ee73ebf43e79fe8dcf291d242945
treef54691e0f59e0d52e2df4527eb29bab215c7ad7b
parent0e08325baafb87cfec2f89293c4755e6167e66ea
terminal-util: when querying bg color, ensure input fd and output fd refer to same tty

Let's add an extra safety check: before issuing the ansi sequence to
query the bg color, let's make sure input and output fd actually
reference the same tty. because otherwise it's unlikely we'll be able to
read back the response from the tty driver.

This is mostly just paranoia.
src/basic/terminal-util.c