jupyter / terminado

Terminals served by tornado websockets
http://terminado.readthedocs.org/en/latest/
BSD 2-Clause "Simplified" License
368 stars 95 forks source link

preopen_buffer doesn't seem to do much, so why not just use read_buffer #126

Closed Wh1isper closed 3 months ago

Wh1isper commented 2 years ago

The confusion stems from the fact that during my use of jupyterlab's terminal function, when I refresh the web page in the terminal screen, I only get the messages I didn't receive again, but I lose the history.

Then I tried to find the answer by looking at the code, but I found that we used preopen_buffer but not read_buffer, and I wanted to know the reason for this

After I replaced the preopen_buffer with a read_buffer, not only can I achieve history passing, but also the function of fetching messages when reopening, and I also think there is no need to keep too large a buffer, the current length-independent preopen_buffer may cause some other problems

image

after F5: image

using read_buffer image

No change after F5, more friendly image

Wh1isper commented 2 years ago

I left my demo here:https://github.com/jupyter/terminado/pull/127 Should I ask the same question in jupyterlab and jupyter server? I mean should I patch in jupyter server so as not to affect other downstream projects?