fix missig history file in output director

This commit is contained in:
Lincoln Stein 2022-12-01 11:29:46 +00:00
parent 6982e6a469
commit 9ee83380e6

View File

@ -416,7 +416,11 @@ def get_completer(opt:Args, models=[])->Completer:
readline.parse_and_bind('set skip-completed-text on')
readline.parse_and_bind('set show-all-if-ambiguous on')
histfile = os.path.join(os.path.expanduser(opt.outdir), '.invoke_history')
outdir = os.path.expanduser(opt.outdir)
if os.path.isabs(outdir):
histfile = os.path.join(outdir,'.invoke_history')
else:
histfile = os.path.join(Globals.root, outdir, '.invoke_history')
try:
readline.read_history_file(histfile)
readline.set_history_length(1000)