# How to redirect stdout to an open terminal window?

**URL:** <https://discourse.julialang.org/t/how-to-redirect-stdout-to-an-open-terminal-window/15465>\
**Category:** General Usage\
**Tags:** repl\
**Created:** [September 25, 2018, 12:37pm UTC](https://discourse.julialang.org/t/how-to-redirect-stdout-to-an-open-terminal-window/15465 "2018-09-25T12:37:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Post date:** [September 25, 2018, 12:37pm UTC](https://discourse.julialang.org/t/how-to-redirect-stdout-to-an-open-terminal-window/15465/1 "2018-09-25T12:37:49Z")

</div>

I am having trouble with the function `redirect_stdout`. I would like to do the following on my mac

1. Open up a terminal window with julia
2. Open up a second terminal and run `tty` to get a file name I can pipe results to
3. Use some combination of `open("...terminal name", "w")` and `redirect_stdout` to pipe all output from my julia window to the open window. (Or figure out how to set the global variable `stdout` to this new file).

This is for repl usage, not any particular function.

I can’t seem to do it. `redirect_stdout(io)` doesn’t seem to do anything for the repl. Can anyone help me out?

---

<div class="post-metadata">

**Author:** ![hungchienpeter](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hungchienpeter/32/210583_2.png) [@hungchienpeter](https://discourse.julialang.org/u/hungchienpeter)\
**Post date:** [July 11, 2024, 12:54pm UTC](https://discourse.julialang.org/t/how-to-redirect-stdout-to-an-open-terminal-window/15465/2 "2024-07-11T12:54:18Z")

</div>

You can do this just like [this post](https://discourse.julialang.org/t/redirect-stdout-and-stderr/13424).
