lua CLI should refuse to load if stdin is not valid
Currently, when the lua CLI interface module is probed while the standard input is for example /dev/null
, it will open successfully, but immediately catch EOF and terminate VLC. This is unfortunate for a GUI user who somehow sets up in the preferences, or inherits, a configuration enabling the lua CLI as extra interface: launching VLC from the desktop environment will result in VLC automatically terminating upon startup, with no way to remedy or diagnose.
The C CLI isn't affected, and the lua CLI should implement a similar solution: failing to load the interface module in such a case, and letting the module core move on to the next candidate module. This must be done in the C code of lua interface bindings: due to the troublesome model of lua interface scripts, when the script starts getting run it's already too late to abort and fail loading the module.
There is some question about what constitutes a valid or invalid input to reject, also depending on what input the CLI is configured to listen on. The C CLI checks isatty(0)
.
We also want to preserve the ability of the CLI to take commands from inputs which aren't TTYs such as pipes, so honoring the rc-fake-tty
configuration setting might also be needed.
See https://mailman.videolan.org/pipermail/vlc-devel/2020-May/134185.html , https://mailman.videolan.org/pipermail/vlc-devel/2020-June/134193.html or again https://mailman.videolan.org/pipermail/vlc-devel/2020-June/134189.html