jupyter/terminado

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

Wh1isper opened this issue · 1 comments

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

I left my demo here:#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?