# Problem with package "OhMyREPL" in startup.jl file

**URL:** <https://discourse.julialang.org/t/problem-with-package-ohmyrepl-in-startup-jl-file/45824>\
**Category:** New to Julia\
**Tags:** package, repl, vscode\
**Created:** [August 31, 2020, 12:09pm UTC](https://discourse.julialang.org/t/problem-with-package-ohmyrepl-in-startup-jl-file/45824 "2020-08-31T12:09:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![HerAdri](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heradri/32/5816_2.png) [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Post date:** [August 31, 2020, 12:09pm UTC](https://discourse.julialang.org/t/problem-with-package-ohmyrepl-in-startup-jl-file/45824/1 "2020-08-31T12:09:26Z")

</div>

Hello  
From the link [Dynamic REPL prompt?](https://discourse.julialang.org/t/dynamic-repl-prompt/45524)  
we develop this script for startup.jl

```julia
#OhMyREPL

    try
        @eval using OhMyREPL
		@eval using Crayons
		@eval using Dates
    catch e
        @warn e
    end
using Dates
prompt() = string(Dates.format(Dates.Time(Dates.now()),"HH:MM:SS")) * "->>"
#START
atreplinit() do repl
#1
enable_autocomplete_brackets(true)
#2
cray=Crayon(background=:red,foreground=:green)
OhMyREPL.Passes.BracketHighlighter.setcrayon!(cray)
#3
isdefined(@ __MODULE__ (), :OhMyREPL) ? OhMyREPL.input_prompt!("Julia>",:green) : nothing
isdefined(@ __MODULE__ (), :OhMyREPL) ? OhMyREPL.output_prompt!(prompt,:red) : nothing
#4
OhMyREPL.Passes.RainbowBrackets.activate_16colors()
#5
enable_highlight_markdown(true)

#END
end
#

```

Everything seems to run fine except: enable\_autocomplete\_brackets (true); that both in REPL and VScode, I observe erratic behavior:  
for example:

```julia
using Dates 
days = Dates.datetime2julian.(Dates.DateTime(2018, 1, 1, 0, 0, 0):Dates.Day(1):Dates.DateTime(2018, 12, 31, 0, 0, 0))
eqt_time(d) = -7.65 * sind(d) + 9.87 * sind(2d + 206);
eq_values = map(equation_time, days.-days[1])

Julia> eq_values = map(equation_time, days.-days[1])])
ERROR: syntax: extra token "]" after end of expression
Stacktrace:
 [1] top-level scope at none:1

```

But if you don’t add the bracket and final parenticis to the end of the line, it results

```julia
eq_values = map(equation_time, days.-days[1

eq_values = map(equation_time, days.-days[1])
14:55:49->> 365-element Array{Float64,1}:
 -4.326723218808193
 -4.76719523394196
 -5.201981149774132
 -5.630673203240252
  ⋮
 -5.201981149774132
 -5.630673203240252
 -6.052870981398829

```

What is wrong with the script?  
How to correct this behavior?

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [August 31, 2020, 12:11pm UTC](https://discourse.julialang.org/t/problem-with-package-ohmyrepl-in-startup-jl-file/45824/2 "2020-08-31T12:11:56Z")

</div>

I guess this is on Windows when pasting? This is a bug that stems from the Julia package managers REPL mode overrides the `]` key that OhMyREPL wants to use. You can run with `enable_autocomplete_brackets(false)` until it is fixed.

---

<div class="post-metadata">

**Author:** ![derekmahar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/derekmahar/32/216439_2.png) [@derekmahar](https://discourse.julialang.org/u/derekmahar)\
**Post date:** [August 31, 2020, 2:03pm UTC](https://discourse.julialang.org/t/problem-with-package-ohmyrepl-in-startup-jl-file/45824/3 "2020-08-31T14:03:31Z")

</div>

Does `@eval using OhMyREPL` load the package in the global context? In my startup script, I had to instead load the package with `using OhMyREPL`.
