# Different Base.show for Pluto and REPL

**URL:** https://discourse.julialang.org/t/different-base-show-for-pluto-and-repl/93083
**Category:** General Usage
**Tags:** repl, pluto, show
**Created:** [January 17, 2023, 10:44am UTC](https://discourse.julialang.org/t/different-base-show-for-pluto-and-repl/93083 "2023-01-17T10:44:19Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![filchristou](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/filchristou/32/26760_2.png) [@filchristou](https://discourse.julialang.org/u/filchristou)
#### Post date: [January 17, 2023, 10:44am UTC](https://discourse.julialang.org/t/different-base-show-for-pluto-and-repl/93083/1 "2023-01-17T10:44:19Z")

</div>

I want to have different `Base.show` representations for a struct when I am on REPL and when I am on Pluto by invoking the same code. Is there a more specialized `::MIME` I can use for this purpose, other than `::MIME"text/plain"` ?

### Example

Define a simple struct in a dummy package:

```julia
module PlutoReplShow

export Alpha

struct Alpha
    vec1::Vector{Int}
    vec2::Vector{Int}
    vec3::Vector{Int}
end

# this expression must target only the REPL and not Pluto
Base.show(io::IO, ::MIME"text/plain", a::Alpha) = print(io,"Alpha($(a.vec1[1])...,$(a.vec2[1])..., $(a.vec3[1])...)")

end

```

This code is later invoked by both the REPL and Pluto.  
The defined `Base.show` influences both REPL and Pluto, but I would like to target only the REPL.

So, for the REPL it works fine:

```julia-repl
julia> al = Alpha(1:10, 1:10:100, 2:-1:-30)
Alpha(1...,1..., 2...)

```

but not for Pluto:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/1/7/173c144244e01423738f2dde640f9c3ca7db3732.png)

---

<div class="post-metadata">

### Author: ![jwright11](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jwright11/32/32065_2.png) [@jwright11](https://discourse.julialang.org/u/jwright11)
#### Post date: [April 9, 2025, 1:58pm UTC](https://discourse.julialang.org/t/different-base-show-for-pluto-and-repl/93083/2 "2025-04-09T13:58:49Z")

</div>

Did you ever find a solution for this? I’m looking to do the same thing.

---

<div class="post-metadata">

### Author: ![filchristou](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/filchristou/32/26760_2.png) [@filchristou](https://discourse.julialang.org/u/filchristou)
#### Post date: [April 9, 2025, 2:49pm UTC](https://discourse.julialang.org/t/different-base-show-for-pluto-and-repl/93083/3 "2025-04-09T14:49:17Z")

</div>

Unfortunately, I still don’t have a solution for that.
