Jupyter Notebook output truncation limit across classic and JupyterLab
0 reputation · 14 Mar 2023, 13:55 UTC
0 reputation · 14 Mar 2023, 13:55 UTC
Goal: determine whether stdout and stderr character-level truncation behaves consistently between the classic Jupyter Notebook interface and JupyterLab, and whether NotebookApp.truncated_output_size is reliably enforced in Jupyter Notebook 7.x.
Uncertainty: classic Notebook reportedly truncates long output near 1000 characters by default, while JupyterLab uses a scrollable output area without character-level truncation. Frontend themes may override the classic setting, and the version 7.x output area layout may alter scroll and clipping behavior. These differences require review before assuming a uniform limit.
35275 reputation · 14 Mar 2023, 19:57 UTC
Jupyter Notebook 7.x does not enforce a separate classic-interface truncation limit. Notebook 7.x is built on JupyterLab, so stdout and stderr are rendered in a scrollable output area without character-level truncation. The legacy classic frontend (notebook 6.x and earlier) truncated long text output client-side and offered an expand control, but that behavior does not apply to 7.x. NotebookApp.truncated_output_size is not confirmed as an enforced trait in 7.x; verify it in your installed version before relying on it.
| Statement | Status | Notes |
|---|---|---|
| Legacy classic Notebook (<=6.x) truncates long text output client-side with an expand affordance | Confirmed | Truncation lives in the output-area JavaScript, not in themes; the exact threshold varies by version. |
| JupyterLab and Notebook 7.x show full output in a scrollable area with no character cap | Confirmed | Output remains in the DOM; CSS controls visible height and scrollbars only. |
NotebookApp.truncated_output_size is enforced in Notebook 7.x |
Unverified | Server-side size controls are IOPub rate limits and Tornado message/buffer limits, which drop or reject messages rather than truncate characters. |
| Frontend themes remove characters from output in 7.x | Not supported | Themes can clip or scroll visually, but they do not delete characters from rendered output. |
jupyter notebook --help-all | grep -i truncated_output_size
No output means the option does not exist in this installation.jupyter notebook --generate-config
grep -R "truncated_output_size" ~/.jupyter/jupyter_notebook_config.pyimport sys
text = "x" * 100000
print(text, file=sys.stdout)
print(text, file=sys.stderr)
Open browser developer tools, inspect the output element, and compare scrollHeight with clientHeight. Full text length with a scrollbar indicates scrolling, not truncation.jupyter notebook --help-all | grep -i iopub
Review iopub_data_rate_limit and iopub_msg_rate_limit; these can drop large output independent of the frontend.What is the exact installed version of notebook (and jupyterlab, if present)? If you are running notebook 6.x with the legacy classic frontend, client-side truncation may still apply. On 7.x, the Lab-based scrolling behavior applies instead.
Do not assume a default ~1000-character cap on stdout/stderr in JupyterLab or Notebook 7.x. Long output is fully present in the DOM and only visually scrolled. If output appears missing, investigate IOPub rate limiting or HTTP/WebSocket message size limits before concluding that the frontend truncated it.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.