aboutsummaryrefslogtreecommitdiffstats
path: root/src/epy_reader/reader.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/epy_reader/reader.py')
-rw-r--r--src/epy_reader/reader.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/epy_reader/reader.py b/src/epy_reader/reader.py
index ee615f8..310833a 100644
--- a/src/epy_reader/reader.py
+++ b/src/epy_reader/reader.py
@@ -4,6 +4,7 @@ import dataclasses
import multiprocessing
import os
import re
+import readline
import shutil
import signal
import sqlite3
@@ -135,6 +136,9 @@ class Reader:
self.tts_support: bool = bool(self._tts_speaker)
self.is_speaking: bool = False
+ # readline history
+ self.input_history_file = config.input_history_file
+
# multi process & progress percentage
self._multiprocess_support: bool = False if multiprocessing.cpu_count() == 1 else True
self._process_counting_letter: Optional[multiprocessing.Process] = None
@@ -703,6 +707,9 @@ class Reader:
def cleanup(self) -> None:
self.ebook.cleanup()
+ if self.input_history_file:
+ readline.write_history_file(self.input_history_file)
+
if isinstance(self._process_counting_letter, multiprocessing.Process):
if self._process_counting_letter.is_alive():
self._process_counting_letter.terminate()