Listening to multiple inputs instead of just console

When running Cling without ROOT, it waits for C++ input on the console and executes it on enter. With std::cin it also takes stdin input from the console.
But when running with the ROOT GUI components, it also takes input from GUI events (mouse click, etc.), but the console also stays responsive.
How is this implemented in ROOT, and is there a way to specify a list of file descriptors (or similar) at runtime that Cling should listen to?

Hi,

For ROOT, cling is not driving the prompt. Instead, ROOT hands over strings from the input to cling. Those come from the prompt or the GUI.

You can think of libUserInterface as a simple replacement for ROOT :wink: (at least from cling’s point of view).

Cheers, Axel.