Skip to content

Commit 1441247

Browse files
committed
handle empty environment variable case
1 parent 7f63221 commit 1441247

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

base/client.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ stackframe_lineinfo_color() = repl_color("JULIA_STACKFRAME_LINEINFO_COLOR", :bol
3131
stackframe_function_color() = repl_color("JULIA_STACKFRAME_FUNCTION_COLOR", :bold)
3232

3333
function repl_cmd(cmd, out)
34-
shell = shell_split(get(ENV, "JULIA_SHELL", Sys.iswindows() ? "cmd" : get(ENV, "SHELL", "/bin/sh")))
34+
shell = get(ENV, "JULIA_SHELL", nothing)
35+
if shell === nothing || isempty(shell)
36+
shell = Sys.iswindows() ? "cmd" : get(ENV, "SHELL", "/bin/sh")
37+
end
38+
shell = shell_split(shell)
3539
shell_name = Base.basename(shell[1])
3640
if Sys.iswindows()
3741
shell_name = lowercase(splitext(shell_name)[1]) # canonicalize for comparisons below

0 commit comments

Comments
 (0)