Is it possible to multiplex a terminal window using Ruby with something like Pry or Readline/Coolline?

StackOverflow https://stackoverflow.com/questions/17355252

  •  01-06-2022
  •  | 
  •  

Question

Using Ruby, I'd like to produce a multiplexed terminal window whereby in one "sub" window I can dynamically update displayed data from the underlying application and in another "sub" window I can support user input for controlling the underlying application.

Is this possible with something like Pry or Readline/Coolline?

I can produce each window individually, I just don't know how to multiplex the terminal into two "sub" windows driven by the same application. I'd like to avoid having to use two separate terminal windows, which would require a multi-processed application.

Was it helpful?

Solution

I think the right approach is to synthesize the single whole window, with the so-called "sub-windows" being logical abstractions that update the data for only their own designated region, so the actual display is, essentially, composited by the master view.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top