# Julia is not rendering text correctly in the REPL

**URL:** <https://discourse.julialang.org/t/julia-is-not-rendering-text-correctly-in-the-repl/74098>\
**Category:** General Usage\
**Tags:** question\
**Created:** [January 5, 2022, 6:43pm UTC](https://discourse.julialang.org/t/julia-is-not-rendering-text-correctly-in-the-repl/74098 "2022-01-05T18:43:14Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![etorkia](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/etorkia/32/11677_2.png) [@etorkia](https://discourse.julialang.org/u/etorkia)\
**Post date:** [January 5, 2022, 6:43pm UTC](https://discourse.julialang.org/t/julia-is-not-rendering-text-correctly-in-the-repl/74098/1 "2022-01-05T18:43:14Z")

</div>

Currently, I am running very simple loops using a custom function that generate an array. I am then taking the last value of the array and pushing it into another. Fortunately the function returns the right values but all the print statements are broken… only returning blank lines until the final result.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/9/4/943a1239d5783c576efc33c7f6de1d47521f1e61.png)

Furthermore, the welcome screen doesn’t seem to render either.

 ![JuliaBrokenWelcom](https://global.discourse-cdn.com/julialang/original/3X/0/b/0b9e0b4bbb0f5638a19f4058f631270c91324997.png)

So, for example, I am running a calculation and then asking it to print using a print() statement - what I get is 100 blank lines and then the last result. Any thoughts?

```julia
function marty(Wager, GamesPlayed; GameWinProb = 0.5, CashInHand = Wager)
    CurrentWager = Wager
    Balance = CashInHand
    BalResults = []
        for i = 1:GamesPlayed
            win_loose_sim = rand(Bernoulli(GameWinProb))

            if win_loose_sim == true
                    Balance = Balance + CurrentWager
                    CurrentWager = Wager
                elseif win_loose_sim == false
                    Balance = Balance - CurrentWager
                    CurrentWager = Wager * 2
            end
            push!(BalResults, Balance)
        end

println()
#println("Gain/Loss after $GamesPlayed games: ", Balance - CashInHand,'$')
return BalResults
end

```

Here is the offending function

```julia
function x_hand_dist(trials, games)
finalresult = []

for i = 1:trials
    trial_result = last(marty(5, games, GameWinProb = 0.185, CashInHand = 400))
    #print(trial_result)
    push!(finalresult, trial_result)

end

return finalresult
end

```

Same Issue but worse…

```julia
function resim()
trials = 1000
    for games = 10:5:1000
        sim = mean(x_hand_dist(trials, games))
        #print("Total Games:", games," ","Mean Balance:", sim)

       if sim < 0
                println("Total Games:", games," ","Mean Balance:", mean(x_hand_dist(trials, games)))
            break
        else
            println("Total Games:", games," ","Mean Balance:", sim)
        end
    end
end

```

---

<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:** [January 5, 2022, 6:48pm UTC](https://discourse.julialang.org/t/julia-is-not-rendering-text-correctly-in-the-repl/74098/2 "2022-01-05T18:48:57Z")

</div>

Are you using some weird color scheme in your REPL? What terminal are you using?

---

<div class="post-metadata">

**Author:** ![etorkia](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/etorkia/32/11677_2.png) [@etorkia](https://discourse.julialang.org/u/etorkia)\
**Post date:** [January 5, 2022, 7:03pm UTC](https://discourse.julialang.org/t/julia-is-not-rendering-text-correctly-in-the-repl/74098/3 "2022-01-05T19:03:42Z")

</div>

I am using the latest Atom… with Atom One theme

---

<div class="post-metadata">

**Author:** ![etorkia](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/etorkia/32/11677_2.png) [@etorkia](https://discourse.julialang.org/u/etorkia)\
**Post date:** [January 5, 2022, 7:05pm UTC](https://discourse.julialang.org/t/julia-is-not-rendering-text-correctly-in-the-repl/74098/4 "2022-01-05T19:05:05Z")

</div>

I just revised the code to reproduce the error… sorry for the cut and copy mistake lol

---

<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:** [January 5, 2022, 7:25pm UTC](https://discourse.julialang.org/t/julia-is-not-rendering-text-correctly-in-the-repl/74098/5 "2022-01-05T19:25:11Z")

</div>

The code is definitely not what’s causing the error. it’s the color scheme. I would recommend trying a different color scheme.

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [January 5, 2022, 7:28pm UTC](https://discourse.julialang.org/t/julia-is-not-rendering-text-correctly-in-the-repl/74098/6 "2022-01-05T19:28:46Z")

</div>

Nah, pretty sure this is just a known Juno bug where printing at the start of the session sometimes doesn’t work.

---

<div class="post-metadata">

**Author:** ![etorkia](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/etorkia/32/11677_2.png) [@etorkia](https://discourse.julialang.org/u/etorkia)\
**Post date:** [January 5, 2022, 8:43pm UTC](https://discourse.julialang.org/t/julia-is-not-rendering-text-correctly-in-the-repl/74098/7 "2022-01-05T20:43:21Z")

</div>

My first thought but actually the problem is reproducible in VSCode, the straight REPL terminal and on a Jupyter Workbook on a different machine. I reproduced the issue in 1.61, 1.6.5 and 1.7.1

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [January 5, 2022, 8:54pm UTC](https://discourse.julialang.org/t/julia-is-not-rendering-text-correctly-in-the-repl/74098/8 "2022-01-05T20:54:22Z")

</div>

Yes, I’ve seen similar things off an on in the windows terminal with the normal dark mode. Text is intermittently colored black instead of white. Select it, and it turns white.

---

<div class="post-metadata">

**Author:** ![bkamins](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bkamins/32/208538_2.png) [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Post date:** [January 5, 2022, 8:56pm UTC](https://discourse.julialang.org/t/julia-is-not-rendering-text-correctly-in-the-repl/74098/9 "2022-01-05T20:56:57Z")

</div>

Remove `println()` line in your `marty` function and all will be OK I think.

After removing it I get:

```julia
julia> resim()
Total Games:10 Mean Balance:346.12
Total Games:15 Mean Balance:315.99
Total Games:20 Mean Balance:288.535
Total Games:25 Mean Balance:260.39
Total Games:30 Mean Balance:229.455
Total Games:35 Mean Balance:200.685
Total Games:40 Mean Balance:174.51
Total Games:45 Mean Balance:146.775
Total Games:50 Mean Balance:116.83
Total Games:55 Mean Balance:87.255
Total Games:60 Mean Balance:57.7
Total Games:65 Mean Balance:32.285
Total Games:70 Mean Balance:0.92
Total Games:75 Mean Balance:-28.545

```

---

<div class="post-metadata">

**Author:** ![etorkia](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/etorkia/32/11677_2.png) [@etorkia](https://discourse.julialang.org/u/etorkia)\
**Post date:** [January 5, 2022, 10:05pm UTC](https://discourse.julialang.org/t/julia-is-not-rendering-text-correctly-in-the-repl/74098/10 "2022-01-05T22:05:53Z")

</div>

Bogumil, you rock! I would have never guessed that that println() would cascade like that in my other functions. A true discovery.
