# Remove blank lines in REPL

**URL:** https://discourse.julialang.org/t/remove-blank-lines-in-repl/10996
**Category:** General Usage
**Tags:** repl
**Created:** [May 18, 2018, 3:48pm UTC](https://discourse.julialang.org/t/remove-blank-lines-in-repl/10996 "2018-05-18T15:48:22Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![r4f](https://avatars.discourse-cdn.com/v4/letter/r/cdc98d/32.png) [@r4f](https://discourse.julialang.org/u/r4f)
#### Post date: [May 18, 2018, 3:48pm UTC](https://discourse.julialang.org/t/remove-blank-lines-in-repl/10996/1 "2018-05-18T15:48:23Z")

</div>

Does anybody know a way to get rid of the blank line in the REPL which appears everytime before an input prompt (except for example when using print(sth))?

I like to use julia as a quick calculator-tool from the terminal for a few operations. But I don’t like wasted space, because then I can see less.

```julia
[~]$ julia -q
julia> 3+3
6

julia> 
[~]$ 

```

In comparison in python it would look like this:

```python
[~]$ python3 -q
>>> 3+3
6
>>> 
[~]$

```

---

<div class="post-metadata">

### Author: ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)
#### Post date: [January 26, 2020, 5:50am UTC](https://discourse.julialang.org/t/remove-blank-lines-in-repl/10996/2 "2020-01-26T05:50:00Z")

</div>

I came across the solution by accident. The culprit here is `REPLDisplay`.

There are two methods to get rid of it in favor of a simpler `TextDisplay`:

Method 1: Pop the `REPLDisplay` off

```julia
Base.Multimedia.popdisplay();

```

Method 2: Add a new `TextDisplay`

```julia
Base.Multimedia.pushdisplay(TextDisplay(stdout));

```

After using one the two methods above, the output will look like this:

```julia
julia> 5+5
10
julia> 3+3
6
julia> 

```

Unfortunately, I have not yet figured out how to incorporate that into the startup. It seems `REPLDisplay` is added after the startup script is executed.

---

<div class="post-metadata">

### Author: ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)
#### Post date: [January 26, 2020, 9:34am UTC](https://discourse.julialang.org/t/remove-blank-lines-in-repl/10996/3 "2020-01-26T09:34:11Z")

</div>

If you put this in ~/.julia/config/startup.jl, then the extra blank line goes away.

```julia
import REPL: REPLDisplay, display, outstream, answer_color
function display(d::REPLDisplay, mime::MIME"text/plain", x)
    io = outstream(d.repl)
    get(io, :color, false) && write(io, answer_color(d.repl))
    if isdefined(d.repl, :options) && isdefined(d.repl.options, :iocontext)
        # this can override the :limit property set initially
        io = foldl(IOContext, d.repl.options.iocontext,
                   init=IOContext(io, :limit => true, :module => Main))
    end
    show(io, mime, x)
    nothing
end

```

I just removed the `println(io)` at [julia/REPL.jl at 9790a8db1cb65cb8d1081cd14706939f49e9a771 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/blob/9790a8db1cb65cb8d1081cd14706939f49e9a771/stdlib/REPL/src/REPL.jl#L138)
