Skip to content

Add configurable REPL output size limits#47114

Merged
miguelraz merged 14 commits intozed-industries:mainfrom
cvanelteren:repl-output-max-height
Feb 3, 2026
Merged

Add configurable REPL output size limits#47114
miguelraz merged 14 commits intozed-industries:mainfrom
cvanelteren:repl-output-max-height

Conversation

@cvanelteren
Copy link
Copy Markdown
Contributor

Closes #47113

Adds configurable REPL output size limits with two new settings, repl.output_max_height_lines and repl.output_max_width_columns, so large outputs scroll instead of expanding and images scale down to fit the available space. The output containers in both inline REPL blocks and notebook cells now respect these bounds, and image sizing uses the same text metrics as the terminal output for consistent column-based width calculations.

Release Notes:

  • REPL output now supports configurable max height and width limits, with large outputs scrolling and images scaling to stay within the viewport.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jan 18, 2026
let font_id = text_system.resolve_font(&text_style.font());
let cell_width = text_system
.advance(font_id, font_pixels, 'w')
.unwrap()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have a default come out here instead of unwrapping, if it seems sensible. That or return None as bailing would be worse than falling back to None.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented, thanks.

@@ -21,7 +21,4730 @@ As you type in the search box, matching settings appear with descriptions and co

### User Settings

Your user settings apply globally across all projects. Open the file with {#kb zed::OpenSettingsFile} or run `zed: open settings file` from the command palette.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to make all these changes to the configuring zed document? I have no opinions on the content but this should not be in this PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Copy Markdown
Collaborator

@rgbkrk rgbkrk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is sensible. Thanks for the contribution. Only two things to address - the unwrap in max_width_for_columns and removing the changes from docs/src/configuring-zed.md.

@rgbkrk rgbkrk added the area:repl repl, jupyter, notebooks, etc label Jan 22, 2026
@cvanelteren cvanelteren requested a review from rgbkrk January 22, 2026 22:48
@cvanelteren
Copy link
Copy Markdown
Contributor Author

Thanks @rgbkrk -- I had an old version of the zed repo fork hence the weird docs. Should be good now.

@@ -1,136 +1,4998 @@
# Configuring Zed
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you do a git checkout from main for this file so that we don't have any changes in this file?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what went wrong there -- it is restored now

.px_5()
.rounded_lg()
.border_1()
// .border_color(cx.theme().colors().border)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These comments should be deleted now.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks done.

};

div()
// .w_full()
Copy link
Copy Markdown
Contributor

@miguelraz miguelraz Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These comments also should be deleted if they're not being used

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Done.

@cvanelteren
Copy link
Copy Markdown
Contributor Author

@miguelraz is there anything else that needs to change?

@miguelraz
Copy link
Copy Markdown
Contributor

@cvanelteren Yes, I think some basic unit tests are indispensable here. The repl crate doesn't have many tests to start with and it would be healthy for test coverage to grow, IMO.

@rgbkrk has approved the implementation changes and I see nothing to change there.

@cvanelteren
Copy link
Copy Markdown
Contributor Author

Added some basic tests @miguelraz; ping me if you need more.

@miguelraz
Copy link
Copy Markdown
Contributor

LGTM - I don't see any of the float checks going haywire in our pixel-calculating conditions, so they unit tests seem sound.

There are some clippy tests you should address @cvanelteren.

@cvanelteren
Copy link
Copy Markdown
Contributor Author

Passing locally @miguelraz

@miguelraz miguelraz enabled auto-merge (squash) February 3, 2026 04:28
@miguelraz miguelraz merged commit 602d64f into zed-industries:main Feb 3, 2026
27 checks passed
@cvanelteren
Copy link
Copy Markdown
Contributor Author

Thanks @miguelraz; I am not following the release schedule closely on zed, when would this be released on preview?

@cvanelteren cvanelteren deleted the repl-output-max-height branch February 3, 2026 21:10
@miguelraz
Copy link
Copy Markdown
Contributor

@cvanelteren should make it into Preview and Nightly tomorrow :)

adb-sh pushed a commit to adb-sh/zed that referenced this pull request Feb 5, 2026
Closes zed-industries#47113

Adds configurable REPL output size limits with two new settings,
`repl.output_max_height_lines` and `repl.output_max_width_columns`, so
large outputs scroll instead of expanding and images scale down to fit
the available space. The output containers in both inline REPL blocks
and notebook cells now respect these bounds, and image sizing uses the
same text metrics as the terminal output for consistent column-based
width calculations.

Release Notes:

- REPL output now supports configurable max height and width limits,
with large outputs scrolling and images scaling to stay within the
viewport.
naaiyy added a commit to Glass-HQ/Glass that referenced this pull request Feb 16, 2026
Key changes:
- Reduce monomorphizations in GPUI app.rs (zed-industries#48014)
- Entities no longer implement Element directly, go through AnyElement (zed-industries#48217)
- D3D11 resource upload optimization (zed-industries#48282)
- Migrate features.edit_prediction_provider to edit_predictions.provider (zed-industries#48224)
- Make mercury and sweep non-experimental (zed-industries#48227)
- CompanionView consolidation in block_map (zed-industries#48223)
- Show memory used by language servers (zed-industries#48226)
- Settings links open sub pages (zed-industries#48212)
- Tool security rules that can't be overridden (zed-industries#48209)
- Add sweep_ai privacy mode setting (zed-industries#48220)
- Configurable REPL output size limits (zed-industries#47114)
- Fix .editorconfig files in subdirectories (zed-industries#48203)
- Security updates: bytes v1.11.1, jsonwebtoken v10
- Git UI: hide "View on GitHub" for stashes (zed-industries#48271)
- Indent guide fix in tree view with collapsed folders (zed-industries#48194)
- Edit prediction fixes and improvements

Conflict resolution:
- collab/completion.rs, collab/rpc.rs: deleted (collab removed)
- vim/search.rs: deleted (vim removed)
- livekit_api/Cargo.toml: deleted (livekit removed)
- GPUI files: deleted from Glass (handled in Obsydian-HQ/gpui)
- migrations: combined both ours (m_2026_02_06) and upstream (m_2026_02_02, m_2026_02_03)
- project.rs: kept collab functions removed, restored handle_create_file_for_peer for remote dev
- lsp_store.rs: removed collab-only set_language_server_statuses_from_proto
- proto.rs: kept CreateFileForPeer, removed CreateChannel/CreateChannelResponse
- remote_servers.rs: merged import lists (kept native button imports + added Action)

Co-Authored-By: Claude Opus 4.6 <[email protected]>
MrSubidubi added a commit that referenced this pull request Mar 4, 2026
Continues #47114

Release Notes:

- Fixed REPL output width clamping to apply to the content area so
images don’t get clipped by controls

---------

Co-authored-by: MrSubidubi <[email protected]>
tahayvr pushed a commit to tahayvr/zed that referenced this pull request Mar 4, 2026
Continues zed-industries#47114

Release Notes:

- Fixed REPL output width clamping to apply to the content area so
images don’t get clipped by controls

---------

Co-authored-by: MrSubidubi <[email protected]>
wzulfikar pushed a commit to wzulfikar/zed that referenced this pull request Mar 4, 2026
Continues zed-industries#47114

Release Notes:

- Fixed REPL output width clamping to apply to the content area so
images don’t get clipped by controls

---------

Co-authored-by: MrSubidubi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:repl repl, jupyter, notebooks, etc cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants