Show More
@@ -55,6 +55,10 b' class HistoryManager(object):' | |||||
55 | # ShadowHist instance with the actual shadow history |
|
55 | # ShadowHist instance with the actual shadow history | |
56 | shadow_hist = None |
|
56 | shadow_hist = None | |
57 |
|
57 | |||
|
58 | # Offset so the first line of the current session is #1. Can be | |||
|
59 | # updated after loading history from file. | |||
|
60 | session_offset = -1 | |||
|
61 | ||||
58 | # Private interface |
|
62 | # Private interface | |
59 | # Variables used to store the three last inputs from the user. On each new |
|
63 | # Variables used to store the three last inputs from the user. On each new | |
60 | # history update, we populate the user's namespace with these, shifted as |
|
64 | # history update, we populate the user's namespace with these, shifted as | |
@@ -69,8 +73,12 b' class HistoryManager(object):' | |||||
69 | def __init__(self, shell, load_history=False): |
|
73 | def __init__(self, shell, load_history=False): | |
70 | """Create a new history manager associated with a shell instance. |
|
74 | """Create a new history manager associated with a shell instance. | |
71 |
|
75 | |||
72 | If load_history is true, it will load the history from file and set the |
|
76 | Parameters | |
73 | session offset so that the next line typed can be retrieved as #1. |
|
77 | ---------- | |
|
78 | load_history: bool, optional | |||
|
79 | If True, history will be loaded from file, and the session | |||
|
80 | offset set, so that the next line entered can be retrieved | |||
|
81 | as #1. | |||
74 | """ |
|
82 | """ | |
75 | # We need a pointer back to the shell for various tasks. |
|
83 | # We need a pointer back to the shell for various tasks. | |
76 | self.shell = shell |
|
84 | self.shell = shell | |
@@ -82,9 +90,6 b' class HistoryManager(object):' | |||||
82 | # it was exactly typed in by the user, with %hist -r. |
|
90 | # it was exactly typed in by the user, with %hist -r. | |
83 | self.input_hist_raw = [] |
|
91 | self.input_hist_raw = [] | |
84 |
|
92 | |||
85 | # Offset so the first line of the current session is #1 |
|
|||
86 | self.session_offset = -1 |
|
|||
87 |
|
||||
88 | # list of visited directories |
|
93 | # list of visited directories | |
89 | try: |
|
94 | try: | |
90 | self.dir_hist = [os.getcwd()] |
|
95 | self.dir_hist = [os.getcwd()] |
General Comments 0
You need to be logged in to leave comments.
Login now