Skip to content

Notebooks: backspaces are rendered as printable rather than control characters in output cells #13069

@bvenreply

Description

@bvenreply

Bug Description:

Backspaces are rendered as printable rather than control characters in notebook output cells.

Here's an example, from the Keras curses-like model training progress reporting interface:

image

Steps to Reproduce:

  • Create a Jupyter notebook in Theia, and run this python code within a cell:
    import time
    
    msg = "abcdef"
    
    for i in range(5):
        print(msg, end="")
        time.sleep(1)
        for j in msg:
            print("\b", end="", flush=True)
        time.sleep(0.5)

Here's a comparison with the same code run in vscode, which displays the expected output:

image

Additional Information

  • Operating System: 5.10.192-183.736.amzn2.x86_64 GNU/Linux on the server 6.1.0-13-amd64 GNU/Linux on the client
  • Theia Version: 1.43.1
  • Browser: Chromium version 119.0.6045.105
  • Python jupyter kernel: tested with 3.8, 3.11 and 3.12

This is a less trivial issue than it may appear: taking the above example of Keras model training, note that many thousands of these lines are printed throughout the model training and the cell attempts to render them all, to the point that the browser is slowed down and the notebook becomes unusable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    notebookissues related to notebooks

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions