# Proper way to hook into REPL display of type

**URL:** <https://discourse.julialang.org/t/proper-way-to-hook-into-repl-display-of-type/2046>\
**Category:** General Usage\
**Tags:** question\
**Created:** [February 11, 2017, 11:55pm UTC](https://discourse.julialang.org/t/proper-way-to-hook-into-repl-display-of-type/2046 "2017-02-11T23:55:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Evizero](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evizero/32/10118_2.png) [@Evizero](https://discourse.julialang.org/u/Evizero)\
**Post date:** [February 11, 2017, 11:55pm UTC](https://discourse.julialang.org/t/proper-way-to-hook-into-repl-display-of-type/2046/1 "2017-02-11T23:55:55Z")

</div>

I want to overwrite how a particular type is displayed if my package is loaded, but only in the interactive REPL.

I found that I can overload `display(d::Base.REPL.REPLDisplay, ...)`, but now I am a bit stuck without digging in Base code.

Right now I do the naive thing and just `print("something")` in that function which has the desired effect, but I wonder if that may have some edgecases I did not consider. It also looks different than other output (the text in the first line isn’t bold)

![](https://global.discourse-cdn.com/julialang/original/3X/d/4/d45da5d8678c6ea77a89bf6ff638b2dcc04e83e4.png)

I did try `print(d, "something")` but that did not have the effect I expected.

Any pointers?

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [February 12, 2017, 12:50am UTC](https://discourse.julialang.org/t/proper-way-to-hook-into-repl-display-of-type/2046/2 "2017-02-12T00:50:30Z")

</div>

Don’t override display. See

[http://docs.julialang.org/en/latest/manual/types.html#Custom-pretty-printing-1](http://docs.julialang.org/en/latest/manual/types.html#Custom-pretty-printing-1)
