open_x11.RdIterate through displays to find an X11 display to use.
open_x11(display_id = 10, max_attempts = 10)Starting display ID
Number of displays to try
Invisibly returns the opened display ID.
When reconnecting a tmux session, the R session may no longer be able to open an X11 window. In such cases, the display ID may have changed between the R session opening and the tmux session reconnecting. This function iterates over the displays until one can be used or max_attempts is reached.