File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -2,14 +2,15 @@ name = "REPL"
22uuid = " 3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
33
44[deps ]
5+ FileWatching = " 7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"
56InteractiveUtils = " b77e0a4c-d291-57a0-90e8-8db25a27a240"
67Markdown = " d6f4376e-aef5-505a-96c1-9c027394607a"
78Sockets = " 6462fe0b-24de-5631-8697-dd941f90decc"
89Unicode = " 4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
910
1011[extras ]
11- Test = " 8dfed614-e22c-5e08-85e1-65c5234f0b40"
1212Random = " 9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
13+ Test = " 8dfed614-e22c-5e08-85e1-65c5234f0b40"
1314
1415[targets ]
1516test = [" Test" , " Random" ]
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ Base.Experimental.@optlevel 1
1717
1818using Base. Meta, Sockets
1919import InteractiveUtils
20+ import FileWatching
2021
2122export
2223 AbstractREPL,
@@ -642,7 +643,6 @@ function add_history(hist::REPLHistoryProvider, s::PromptState)
642643 # mode: $mode
643644 $(replace (str, r" ^" ms => " \t " ))
644645 """
645- # TODO : write-lock history file
646646 try
647647 seekend (hist. history_file)
648648 catch err
@@ -651,8 +651,10 @@ function add_history(hist::REPLHistoryProvider, s::PromptState)
651651 # If this doesn't fix it (e.g. when file is deleted), we'll end up rethrowing anyway
652652 hist_open_file (hist)
653653 end
654- print (hist. history_file, entry)
655- flush (hist. history_file)
654+ FileWatching. mkpidlock (hist. file_path * " .pid" , stale_age= 3 ) do
655+ print (hist. history_file, entry)
656+ flush (hist. history_file)
657+ end
656658 nothing
657659end
658660
You can’t perform that action at this time.
0 commit comments