Skip to content

Commit

Permalink
move history file to ~/.julia/logs/repl_history.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKarpinski committed Feb 22, 2018
1 parent 9f8bdf4 commit ac910f3
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions stdlib/REPL/src/REPL.jl
Original file line number Diff line number Diff line change
Expand Up @@ -671,16 +671,8 @@ function return_callback(s)
end
end

function find_hist_file()
filename = ".julia_history"
if isfile(filename)
return filename
elseif haskey(ENV, "JULIA_HISTORY")
return ENV["JULIA_HISTORY"]
else
return joinpath(homedir(), filename)
end
end
find_hist_file() = get(ENV, "JULIA_HISTORY",
joinpath(homedir(), ".julia", "logs", "repl_history.jl"))

backend(r::AbstractREPL) = r.backendref

Expand Down Expand Up @@ -837,6 +829,7 @@ function setup_interface(
if repl.history_file
try
hist_path = find_hist_file()
mkpath(dirname(hist_path))
f = open(hist_path, read=true, write=true, create=true)
finalizer(replc) do replc
close(f)
Expand Down

0 comments on commit ac910f3

Please sign in to comment.