Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b65d977

Browse files
authored
Merge pull request #11014 from ghost/make-prompt-tookit-history-search-configurable
making prompt_tolkit history search configurable
2 parents cc353b2 + 333a6a8 commit b65d977

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

IPython/terminal/interactiveshell.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ class _NoStyle(Style): pass
5757
Token.OutPromptNum: '#bb0000 bold',
5858
}
5959

60-
61-
6260
def get_default_editor():
6361
try:
6462
return os.environ['EDITOR']
@@ -208,6 +206,10 @@ def _displayhook_class_default(self):
208206
"may be changed or removed in later releases."
209207
).tag(config=True)
210208

209+
enable_history_search = Bool(True,
210+
help="Allows to enable/disable the prompt toolkit history search"
211+
).tag(config=True)
212+
211213
@observe('term_title')
212214
def init_term_title(self, change=None):
213215
# Enable or disable the terminal title.
@@ -271,7 +273,7 @@ def patch_stdout(**kwargs):
271273
history=history,
272274
completer=IPythonPTCompleter(shell=self,
273275
patch_stdout=patch_stdout),
274-
enable_history_search=True,
276+
enable_history_search=self.enable_history_search,
275277
style=self.style,
276278
mouse_support=self.mouse_support,
277279
**self._layout_options()

0 commit comments

Comments
 (0)