Skip to content

Commit 74ec1f9

Browse files
dot files: move history file to ~/.julia/logs/repl_history.jl
1 parent 33ca610 commit 74ec1f9

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

stdlib/REPL/src/REPL.jl

+3-10
Original file line numberDiff line numberDiff line change
@@ -671,16 +671,8 @@ function return_callback(s)
671671
end
672672
end
673673

674-
function find_hist_file()
675-
filename = ".julia_history"
676-
if isfile(filename)
677-
return filename
678-
elseif haskey(ENV, "JULIA_HISTORY")
679-
return ENV["JULIA_HISTORY"]
680-
else
681-
return joinpath(homedir(), filename)
682-
end
683-
end
674+
find_hist_file() = get(ENV, "JULIA_HISTORY",
675+
joinpath(homedir(), ".julia", "logs", "repl_history.jl"))
684676

685677
backend(r::AbstractREPL) = r.backendref
686678

@@ -837,6 +829,7 @@ function setup_interface(
837829
if repl.history_file
838830
try
839831
hist_path = find_hist_file()
832+
mkpath(dirname(hist_path))
840833
f = open(hist_path, read=true, write=true, create=true)
841834
finalizer(replc) do replc
842835
close(f)

0 commit comments

Comments
 (0)