From a3916594e488cf6095c90a1d2a25ccbeefb0efe1 Mon Sep 17 00:00:00 2001 From: Petr Vana Date: Tue, 5 Oct 2021 20:49:02 +0200 Subject: [PATCH 1/5] Fix Base.isinteractive() for startup files --- base/client.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/base/client.jl b/base/client.jl index 7e5f1ab5c5d58..823fc6027f58c 100644 --- a/base/client.jl +++ b/base/client.jl @@ -252,6 +252,9 @@ function exec_options(opts) invokelatest(Main.Distributed.process_opts, opts) end + interactiveinput = (repl || is_interactive) && isa(stdin, TTY) + is_interactive |= interactiveinput + # load ~/.julia/config/startup.jl file if startup try @@ -299,9 +302,7 @@ function exec_options(opts) end repl |= is_interactive::Bool if repl - interactiveinput = isa(stdin, TTY) if interactiveinput - global is_interactive = true banner = (opts.banner != 0) # --banner!=no else banner = (opts.banner == 1) # --banner=yes From 4c2abdf368aece0af37e3c55120fca79acd17616 Mon Sep 17 00:00:00 2001 From: Petr Vana Date: Wed, 6 Oct 2021 00:00:20 +0200 Subject: [PATCH 2/5] Update base/client.jl Co-authored-by: Jeff Bezanson --- base/client.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/client.jl b/base/client.jl index 823fc6027f58c..d585774115990 100644 --- a/base/client.jl +++ b/base/client.jl @@ -252,7 +252,7 @@ function exec_options(opts) invokelatest(Main.Distributed.process_opts, opts) end - interactiveinput = (repl || is_interactive) && isa(stdin, TTY) + interactiveinput = (repl || is_interactive::Bool) && isa(stdin, TTY) is_interactive |= interactiveinput # load ~/.julia/config/startup.jl file From 2e3b277d182634f031228ec4e50f8ac193012805 Mon Sep 17 00:00:00 2001 From: Petr Vana Date: Wed, 6 Oct 2021 00:08:49 +0200 Subject: [PATCH 3/5] Simplify the code slightly --- base/client.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/base/client.jl b/base/client.jl index d585774115990..ce6940c308044 100644 --- a/base/client.jl +++ b/base/client.jl @@ -300,8 +300,7 @@ function exec_options(opts) end end end - repl |= is_interactive::Bool - if repl + if repl || is_interactive::Bool if interactiveinput banner = (opts.banner != 0) # --banner!=no else From e6c5e4aa107e9205e69228b37218084df590888e Mon Sep 17 00:00:00 2001 From: Petr Vana Date: Wed, 6 Oct 2021 00:12:01 +0200 Subject: [PATCH 4/5] Improve type inference --- base/client.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/client.jl b/base/client.jl index ce6940c308044..7845188e45da8 100644 --- a/base/client.jl +++ b/base/client.jl @@ -261,7 +261,7 @@ function exec_options(opts) load_julia_startup() catch invokelatest(display_error, current_exceptions()) - !(repl || is_interactive) && exit(1) + !(repl || is_interactive::Bool) && exit(1) end end From e4034a738a7782c836bba13bbf319537cd9bf482 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Wed, 6 Oct 2021 18:30:20 -0400 Subject: [PATCH 5/5] Update base/client.jl --- base/client.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/client.jl b/base/client.jl index 7845188e45da8..ffa4eec0c4bd7 100644 --- a/base/client.jl +++ b/base/client.jl @@ -253,7 +253,7 @@ function exec_options(opts) end interactiveinput = (repl || is_interactive::Bool) && isa(stdin, TTY) - is_interactive |= interactiveinput + is_interactive::Bool |= interactiveinput # load ~/.julia/config/startup.jl file if startup