Skip to content
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

Merged
merged 1 commit into from
Jun 9, 2014
Merged

Conversation

minrk
Copy link
Member

@minrk minrk commented May 29, 2014

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

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:
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

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
    
  •        if self._custom_readline_config:
    
    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.


Reply to this email directly or view it on GitHub.

@ellisonbg
Copy link
Member

I have tested this and verified that it does fix the issue. Just one inline comment to address before merging.

minrk added a commit that referenced this pull request Jun 9, 2014
load inputrc after IPython readline config
@minrk minrk merged commit 28b3ed0 into ipython:master Jun 9, 2014
@minrk minrk deleted the inputrc-last branch June 9, 2014 19:16
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
load inputrc after IPython readline config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mapping ctrl-L to something else other then clear-screen doesn't work in readline file ~/.inputrc
2 participants