How to run OhMyREPL.jl with startup.jl?

Hello, all

I decided to add the following piece of code to my startup.jl file to have Revise.jl and OhMyREPL.jl run from the get-go as I open the application

import Pkg
let
    pkgs = ["Revise", "OhMyREPL"]
    for pkg in pkgs
        if Base.find_package(pkg) === nothing
            Pkg.add(pkg)
        end
    end
end

using Revise
using OhMyREPL
colorscheme!("BoxyMonokai256")

In a nutshell, the code is meant to check if the packages are installed. If not, then they’ll be installed. I have checked and the packages are installed and up-to-date.

Despite this addition to the startup.jl file, OhMyREPL.jl isn’t loaded when the application opens. I’m testing this in the actual Julia REPL as opposed to the Julia REPL in VSCode.

Does anyone know if I’ve made a mistake? If so, how do I fix it?
Thank you.

I think OhMyREPL must be loaded only after the REPL is initialized; something like:

atreplinit() do repl
    @eval using OhMyREPL
end

Here’s an example: Cool and fast REPL · JuliaNotes.jl

But my config is like this and it also works (since I am using OhMyREPL.jl & Revise.jl all the time, I just install them all them time and don’t bother checking everytime):

using OhMyREPL
colorscheme!("BoxyMonokai256")

if isfile("Project.toml")
    using Pkg
    Pkg.activate(".")
    @async @eval using Revise
end

Or, you can use what they suggested in their docs and this:

try
    using Revise
catch e
    @warn "Error initializing Revise" exception=(e, catch_backtrace())
end
atreplinit() do repl
    try
        @eval using OhMyREPL
    catch e
        @warn "error while importing OhMyREPL" e
    end
end

if you know OhMyREPL is installed, you can just have

using OhMyREPL
colorscheme!("GruvboxDark") # whatever you want

Strangely enough, I added the docs suggestion to the startup.jl file, but it still does not work. =/
Thank you for your contribution, though.