Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions IPython/core/interactiveshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ def _prompt_trait_changed(self, name, old, new):
# but for now, we can't do that as readline is welded in everywhere.
readline_use = CBool(True, config=True)
readline_remove_delims = Unicode('-/~', config=True)
readline_delims = Unicode() # set by init_readline()
# don't use \M- bindings by default, because they
# conflict with 8-bit encodings. See gh-58,gh-88
readline_parse_and_bind = List([
Expand Down Expand Up @@ -1866,6 +1867,9 @@ def init_readline(self):
delims = delims.replace(d, "")
delims = delims.replace(ESC_MAGIC, '')
readline.set_completer_delims(delims)
# Store these so we can restore them if something like rpy2 modifies
# them.
self.readline_delims = delims
# otherwise we end up with a monster history after a while:
readline.set_history_length(self.history_length)

Expand Down
4 changes: 4 additions & 0 deletions IPython/extensions/rmagic.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,3 +617,7 @@ def R(self, line, cell=None, local_ns=None):
def load_ipython_extension(ip):
"""Load the extension in IPython."""
ip.register_magics(RMagics)
# Initialising rpy2 interferes with readline. Since, at this point, we've
# probably just loaded rpy2, we reset the delimiters. See issue gh-2759.
if ip.has_readline:
ip.readline.set_completer_delims(ip.readline_delims)