# How clear the printed content in terminal and print to the same line?

**URL:** <https://discourse.julialang.org/t/how-clear-the-printed-content-in-terminal-and-print-to-the-same-line/19549>\
**Category:** New to Julia\
**Created:** [January 12, 2019, 3:01am UTC](https://discourse.julialang.org/t/how-clear-the-printed-content-in-terminal-and-print-to-the-same-line/19549 "2019-01-12T03:01:59Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [January 13, 2019, 11:42am UTC](https://discourse.julialang.org/t/how-clear-the-printed-content-in-terminal-and-print-to-the-same-line/19549/9 "2019-01-13T11:42:24Z")

</div>

Yes, the package cannot be accused of being overdocumented 😉 I would try something like

```julia
import REPL.Terminals
terminal = Terminals.TTYTerminal("", stdin, stdout, stderr)

function f(terminal)
    print("this message will self-destruct in 5 seconds")
    sleep(5)
    REPL.Terminals.clear_line(terminal)
    print("bang")
end

f(terminal)

```

but I am not an expert on this.

---

_[View the full topic](https://discourse.julialang.org/t/how-clear-the-printed-content-in-terminal-and-print-to-the-same-line/19549)._
