xterm.js icon indicating copy to clipboard operation
xterm.js copied to clipboard

resize debounce in clients.ts

Open jerch opened this issue 3 years ago • 4 comments

Idea to relief some stress from terminal reflow events - create a Terminal.resizeLazy(rows, cols, timeout?) variant, and likewise a FitAddon.fitLazy variant, which debounces resizing within a certain timeout. This would help during window resizing to avoid processing every single number change, and also lower the back-messaging and reflow stress on application side (less SIGWINCH signals).

Not sure if this is useful from UX perspective, prolly needs some experimenting/testing. To be discussed.

jerch avatar Sep 13 '22 12:09 jerch

I think the resize experience is best done by the embedder as it's easy to wrap resize calls in a debouncer. We could recommend this in the .d.ts docs though?

Tyriar avatar Sep 13 '22 13:09 Tyriar

I think the resize experience is best done by the embedder as it's easy to wrap resize calls in a debouncer. We could recommend this in the .d.ts docs though?

Yes good idea. While I think that this is best left to embedders, most integrations I've came across dont care at all. So not sure, if a doc note will kick enough to get devs out of their comfort zone, lol. (Btw its the same with flow control, ppl simply dont care, sometimes it seems ppl dont know what going on, hmm... /rant off)

jerch avatar Sep 13 '22 14:09 jerch

How about we put a simple debouncer into client.ts as well as the docs?

It's fine if people don't care so much about their projects 🤷 it may not be important for them.

Tyriar avatar Sep 13 '22 15:09 Tyriar

Changed the title - so lets do a resize debouncer in client.ts + docs about it.

jerch avatar Sep 13 '22 15:09 jerch