`show` and `displaysize`

When the REPL outputs something (here), it uses an IOContext to tell show to limit output. You can do the same thing with

show(IOContext(stdout, :limit=>true), "text/plain", L)

Use the context keyword parameter of sprint correctly — it should be something like :limit=>true as explained in the docs, not stdout:

sprint(show, "text/plain", L; context=:limit=>true)

or you can alternatively use repr:

repr("text/plain", L; context=:limit=>true)
4 Likes