81 lines
1.8 KiB
Julia
81 lines
1.8 KiB
Julia
module Setup
|
|
|
|
import REPL
|
|
import Pkg
|
|
|
|
export about, @about
|
|
|
|
@static if VERSION >= v"1.8"
|
|
TERM::Ref{String} = get(ENV, "TERM", "")
|
|
IS_SSH::Ref{Bool} = Ref(false)
|
|
else
|
|
TERM = get(ENV, "TERM", "")
|
|
IS_SSH = Ref(false)
|
|
end
|
|
|
|
include("install.jl")
|
|
|
|
include("cmdpuns.jl")
|
|
include("termsetup.jl")
|
|
include("about.jl")
|
|
include("pkgstack.jl")
|
|
|
|
include("autoloads.jl")
|
|
using .Autoloads
|
|
include("autoload_data.jl")
|
|
|
|
include("sessions.jl")
|
|
using .Sessions
|
|
|
|
using .PkgStack
|
|
|
|
function ensurepkg(pkg::String)
|
|
if isnothing(Base.find_package(pkg))
|
|
@info "Installing $pkg"
|
|
Pkg.add(pkg)
|
|
end
|
|
end
|
|
|
|
function theme_term end # For cairomakie.jl
|
|
|
|
function __init__()
|
|
IS_SSH[] = haskey(ENV, "SSH_CLIENT") || haskey(ENV, "SSH_TTY")
|
|
if isinteractive()
|
|
TERM[] = termcode()
|
|
|
|
Main.Threads.@spawn if TERM[] == "xterm-kitty"
|
|
if isnothing(Base.find_package("KittyTerminalImages"))
|
|
@info "Installing KittyTerminalImages"
|
|
currentproj = Pkg.project().path
|
|
try
|
|
Pkg.activate()
|
|
# Pkg.add("KittyTerminalImages")
|
|
finally
|
|
Pkg.activate(currentproj)
|
|
end
|
|
end
|
|
termtitle(pwd())
|
|
end
|
|
|
|
if ENV["TERM"] != "dumb"
|
|
replsetup()
|
|
end
|
|
end
|
|
end
|
|
|
|
precompile(termtitle, ())
|
|
precompile(replsetup, ())
|
|
precompile(_termcolors, ())
|
|
precompile(termcolors, ())
|
|
precompile(termtheme, ())
|
|
|
|
precompile(Autoloads.autoload_loadpkg, (Symbol,))
|
|
precompile(Autoloads.autoload_scan!, (Expr,))
|
|
precompile(Autoloads.autoload_scan!, (Symbol,))
|
|
precompile(Autoloads.autoload_scan!, (Any,))
|
|
precompile(Autoloads.read_named_envs!, ())
|
|
precompile(Autoloads.repl_scan_autoloads!, (Expr,))
|
|
precompile(Autoloads.repl_scan_autoloads!, (Nothing,))
|
|
|
|
end
|