# How can I clear the REPL's scrollback buffer?

**URL:** https://discourse.julialang.org/t/how-can-i-clear-the-repls-scrollback-buffer/45049
**Category:** General Usage
**Tags:** repl
**Created:** [August 16, 2020, 2:45pm UTC](https://discourse.julialang.org/t/how-can-i-clear-the-repls-scrollback-buffer/45049 "2020-08-16T14:45:20Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![NightMachinary](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nightmachinary/32/14196_2.png) [@NightMachinary](https://discourse.julialang.org/u/NightMachinary)
#### Post date: [August 16, 2020, 2:45pm UTC](https://discourse.julialang.org/t/how-can-i-clear-the-repls-scrollback-buffer/45049/1 "2020-08-16T14:45:20Z")

</div>

I like to clear the REPL’s scrollback buffer programmatically. This helps me when running functions with long outputs, as I can easily use the scrollbar to jump to anywhere in the logs created by that function. Using CTRL-L doesn’t clear the scrollback buffer, it just puts the prompt at the top. The history is still there. It’s also not programmatic. CTRL+L doesn’t do anything in VSCode’s REPL either.

I also like to increase the max scrollback buffer size to a much larger value, so as not to lose any output from any single run.

PS: I am also logging to a file, but it’s a faster workflow to just look at it from the REPL and not bother with opening the text files (which I store at unique locations to preserve the results).

---

<div class="post-metadata">

### Author: ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)
#### Post date: [August 16, 2020, 2:53pm UTC](https://discourse.julialang.org/t/how-can-i-clear-the-repls-scrollback-buffer/45049/2 "2020-08-16T14:53:10Z")

</div>

> [@NightMachinary](#):
>
> max scrollback buffer

I’m 80% this is controlled by your terminal emulator

---

<div class="post-metadata">

### Author: ![NightMachinary](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nightmachinary/32/14196_2.png) [@NightMachinary](https://discourse.julialang.org/u/NightMachinary)
#### Post date: [August 16, 2020, 2:56pm UTC](https://discourse.julialang.org/t/how-can-i-clear-the-repls-scrollback-buffer/45049/3 "2020-08-16T14:56:08Z")

</div>

I thought perhaps the REPL has its own history and scrollback buffer. I should check how configurable the terminal in VSCode is.

---

<div class="post-metadata">

### Author: ![thofma](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thofma/32/1691_2.png) [@thofma](https://discourse.julialang.org/u/thofma)
#### Post date: [August 16, 2020, 5:17pm UTC](https://discourse.julialang.org/t/how-can-i-clear-the-repls-scrollback-buffer/45049/4 "2020-08-16T17:17:03Z")

</div>

The REPL has a history, but if I remember correctly it is infinite (the history is never deleted).

---

<div class="post-metadata">

### Author: ![tbeason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tbeason/32/15898_2.png) [@tbeason](https://discourse.julialang.org/u/tbeason)
#### Post date: [August 16, 2020, 5:30pm UTC](https://discourse.julialang.org/t/how-can-i-clear-the-repls-scrollback-buffer/45049/5 "2020-08-16T17:30:36Z")

</div>

There are 3 separate things here:

REPL history is stored in a file at `~/.julia/logs/repl_history.jl` (for me anyway).

Max scrollback buffer is controlled by your terminal, not by Julia REPL.

Clearing the screen is done by `CTRL+L` as you know.

None of these actually help you with you actual question of how to clear the buffer… I think what you want is `reset` (not the Julia function, the bash command).

---

<div class="post-metadata">

### Author: ![NightMachinary](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nightmachinary/32/14196_2.png) [@NightMachinary](https://discourse.julialang.org/u/NightMachinary)
#### Post date: [August 16, 2020, 9:29pm UTC](https://discourse.julialang.org/t/how-can-i-clear-the-repls-scrollback-buffer/45049/6 "2020-08-16T21:29:20Z")

</div>

I think this should work. I tested `reset` via iTerm, which retained its scrollback history, but VSCode does not retain it. My VSCode Julia REPL is currently busy, so I can’t test it, but I imagine `run(`reset`)` would do. The max scrollback limit is also as you have said.

---

<div class="post-metadata">

### Author: ![t-pollington](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/t-pollington/32/20074_2.png) [@t-pollington](https://discourse.julialang.org/u/t-pollington)
#### Post date: [April 20, 2021, 5:06pm UTC](https://discourse.julialang.org/t/how-can-i-clear-the-repls-scrollback-buffer/45049/7 "2021-04-20T17:06:50Z")

</div>

`clearconsole()`
