Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Carriage return in output doesn't reset to line start #416

Open
gabrielfeo opened this issue May 26, 2023 · 5 comments
Open

Carriage return in output doesn't reset to line start #416

gabrielfeo opened this issue May 26, 2023 · 5 comments

Comments

@gabrielfeo
Copy link
Contributor

gabrielfeo commented May 26, 2023

When a carriage return is printed to cell output,

  • expected: print position reset to line start
  • current: it seems to reset only some N characters back (best described with a picture below)

With the Python kernel, carriage return works as expected. The use case is to print progress to cell output during a long-running operation.

Screenshot 2023-05-26 at 22 19 29 Screenshot 2023-05-26 at 22 19 22
jupyter                  1.0.0
jupyter_client           8.2.0
jupyter-console          6.6.3
jupyter_core             5.3.0
jupyter-events           0.6.3
jupyter-lsp              2.1.0
jupyter_server           2.5.0
jupyter_server_fileid    0.9.0
jupyter_server_terminals 0.4.4
jupyter_server_ydoc      0.8.0
jupyter-ydoc             0.2.4
jupyterlab               4.0.0
jupyterlab-pygments      0.2.2
jupyterlab_server        2.22.1
jupyterlab-widgets       3.0.7
kotlin-jupyter-kernel    0.11.0.385
nbconvert                7.4.0
@ileasile
Copy link
Member

Looks like it's related to the logic of CapturingOutputStream. It flushes the buffer i.e. if some time limit is reached.

In this particular case, increasing output buffer size helps:

%output --max-buffer=10000000

@ileasile
Copy link
Member

@gabrielfeo
Copy link
Contributor Author

Thanks. It does make it reset to line start, but it seems to print out of order and/or lose prints after a certain number of them:

Screenshot 2023-05-26 at 23 40 40

@ileasile
Copy link
Member

So maybe max-time option should be also added
%output --max-buffer=10000000 --max-time=100000

@ileasile
Copy link
Member

%output --max-buffer=100000000 --max-cell-size=100000000
But I think I'll adjust the behavior of \r itself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants