CLIs should check isatty and, if it returns false, disable any interactive functionality because it won’t work.
Please don't do that, expect has to die.
Please don't do that, expect has to die.