-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
load inputrc after IPython readline config #5924
Conversation
There is some subtlety, in that *user* IPython config should be higher priority than inputrc (more specific), but *default* IPython config should be lower (less specific). If readline config is customized, it will be allowed to run on libedit.
if not readline.uses_libedit: | ||
|
||
# load IPython config after inputrc if user has customized | ||
if self._custom_readline_config: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this also have a and not readline.uses_libedit
test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so, but it's arguable. libedit is configurable, but its syntax is slightly different. In master, we prevent users from explicitly configuring libedit because loading readline config was only one action, whether its IPython's defaults or not. After this PR, a user with libedit can configure libedit explicitly, but it will still not load our defaults, which are only for readline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I think this can be merged then.
Sent from my iPhone
On Jun 9, 2014, at 12:04 PM, Min RK notifications@github.com wrote:
In IPython/core/interactiveshell.py:
@@ -1891,14 +1909,10 @@ def init_readline(self):
except:
warn('Problems reading readline initialization file <%s>'% inputrc_name)
# Configure readline according to user's prefs
# This is only done if GNU readline is being used. If libedit
# is being used (as on Leopard) the readline config is
# not run as the syntax for libedit is different.
if not readline.uses_libedit:
# load IPython config after inputrc if user has customized
I don't think so, but it's arguable. libedit is configurable, but its syntax is slightly different. In master, we prevent users from explicitly configuring libedit because loading readline config was only one action, whether its IPython's defaults or not. After this PR, a user with libedit can configure libedit explicitly, but it will still not load our defaults, which are only for readline.if self._custom_readline_config:
—
Reply to this email directly or view it on GitHub.
I have tested this and verified that it does fix the issue. Just one inline comment to address before merging. |
load inputrc after IPython readline config
load inputrc after IPython readline config
There is some subtlety, in that user IPython config should be higher priority than inputrc (more specific), but default IPython config should be lower (less specific).
If readline config is customized, it will be allowed to run on libedit, trusting the user to know what she is doing.
closes #5915