5454 exe (s:: AbstractString , e:: AbstractString ) = s * e
5555end
5656
57+ function display_name (name:: AbstractString )
58+ debugdesc = ccall (:jl_is_debugbuild ,Cint,())== 1 ? " -debug" : " "
59+ return name * " " * Base. VERSION_STRING * debugdesc
60+ end
61+
5762"""
5863 installkernel(name::AbstractString, options::AbstractString...;
5964 julia::Cmd,
6065 specname::AbstractString,
66+ displayname::AbstractString,
6167 env=Dict())
6268
6369Install a new Julia kernel, where the given `options` are passed to the `julia`
@@ -71,6 +77,9 @@ kernelpath = installkernel("Julia O3", "-O3", env=Dict("FOO"=>"yes"))
7177creates a new Julia kernel in which `julia` is launched with the `-O3`
7278optimization flag and `FOO=yes` is included in the environment variables.
7379
80+ The `displayname` argument can be used to customize the name displayed in the
81+ Jupyter kernel list.
82+
7483The returned `kernelpath` is the path of the installed kernel directory,
7584something like `/...somepath.../kernels/julia-o3-1.6` (in Julia 1.6). The
7685`specname` argument can be passed to alter the name of this directory (which
@@ -96,6 +105,7 @@ installkernel(
96105function installkernel (name:: AbstractString , julia_options:: AbstractString... ;
97106 julia:: Cmd = ` $(joinpath (Sys. BINDIR,exe (" julia" ))) ` ,
98107 specname:: AbstractString = kernelspec_name (name),
108+ displayname:: AbstractString = display_name (name),
99109 env:: Dict{<:AbstractString} = Dict {String,Any} ())
100110 # Is IJulia being built from a debug build? If so, add "debug" to the description.
101111 debugdesc = ccall (:jl_is_debugbuild ,Cint,())== 1 ? " -debug" : " "
@@ -112,7 +122,7 @@ function installkernel(name::AbstractString, julia_options::AbstractString...;
112122
113123 ks = Dict (
114124 " argv" => kernelcmd_array,
115- " display_name" => name * " " * Base . VERSION_STRING * debugdesc ,
125+ " display_name" => displayname ,
116126 " language" => " julia" ,
117127 " env" => env,
118128 # Jupyter's signal interrupt mode is not supported on Windows
0 commit comments