From f4d1e94009aeb0eed7eb06eb63fe454cf037a6cd Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Tue, 13 May 2014 13:35:17 -0400 Subject: [PATCH] add -i option. fixes #6765 --- base/client.jl | 4 +++- ui/repl.c | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/base/client.jl b/base/client.jl index c22b382c3e657..78501dd0efd18 100644 --- a/base/client.jl +++ b/base/client.jl @@ -253,6 +253,8 @@ function process_options(args::Vector{UTF8String}) # load juliarc now before processing any more options load_juliarc() startup = false + elseif args[i] == "-i" + global is_interactive = true elseif beginswith(args[i], "--color") if args[i] == "--color" color_set = true @@ -354,7 +356,7 @@ function _start() local term if repl if !isa(STDIN,TTY) - global is_interactive = !isa(STDIN,Union(File,IOStream)) + global is_interactive |= !isa(STDIN,Union(File,IOStream)) color_set || (global have_color = false) else term = Terminals.TTYTerminal(get(ENV,"TERM",@windows? "" : "dumb"),STDIN,STDOUT,STDERR) diff --git a/ui/repl.c b/ui/repl.c index c8c5dae9d9203..52c56d31fe28a 100644 --- a/ui/repl.c +++ b/ui/repl.c @@ -68,6 +68,7 @@ static const char *opts = " -p n Run n local processes\n" " --machinefile file Run processes on hosts listed in file\n\n" + " -i Force isinteractive() to be true\n" " --no-history-file Don't load or save history\n" " -f --no-startup Don't load ~/.juliarc.jl\n" " -F Load ~/.juliarc.jl, then handle remaining inputs\n"