Skip to content

REPL shouldn't auto-show giant outputs #40735

@ericphanson

Description

@ericphanson

copied from Slack:

Related to #40724, I wonder if there’s a way for the REPL to just refuse to print anything too big? Basically I never want 1M characters worth of stuff dumped into the repl, but I run into it all too often (table types without a good show method, deeply nested type parameters, long strings, etc). For each of those there’s a better individual fix but it kinda feels like a bug to me if the repl will just hang or even oom or crash if you show something that doesn’t have a good show method.

I think it should error ("Output too large to display in REPL") or something instead of hanging or trying to print something giant to the REPL.

@pfitzseb mentioned

the issue with that is that you need to buffer the stream internally
but Debugger.jl for example does that

edit: changed the title to "auto-show" instead of print. In my mind, the issue is that when you unexpectedly dump a huge amount of text to the REPL. If you're typing out print(...) then it's probably fine (there's at least some opting-in) but when it's an automatic display, then it's worse if it behaves badly or unexpectedly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    display and printingAesthetics and correctness of printed representations of objects.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions