4

In ipython 5.0, the autocompletion function seems to be replaced by a new one.

Now "os.[tab]" does not display a list of possible commands, but seems to cycle through the module members. But while it does, it seems to display below the current line a list of possible members, but all but the currently selected one are black on black on a standard terminal (urxvt), which worked with ipython 4.0 before just fine.

How can i adjust the colors (of the inactive items) or get back to the old completion mode?

The ipython is a fresh installation in a python2 virtualenv on Debian linux.

Screenshot: enter image description here

When i press tab again, os.abort is hidden and os.access below becomes bright white. Hitting tab a few more times it goes further down and then jumps to the next column with os.chdir. Looks like intended behaviour for this (different) kind of tab completion, but the colors of the inactive entries are wrong.

In KDE "konsole" it behaves differently: enter image description here

in an xterm (with default white background) the font colors are the same, so this does not depend on the terminals color scheme.

I reset my urxvt settings and got with a default white terminal:

So the black / white foreground colors seem to work, but both gray tones are not displayed. I wonder if its an urxvt or ipython bug, maybe with non-standard color names or something similiar.

2
  • Can you tell us what operating system you are using and include an image of your terminal after using <tab> Commented Jul 24, 2016 at 9:46
  • @cel: added a screenshot Commented Jul 24, 2016 at 10:27

3 Answers 3

2

Debian has a separate package rxvt-unicode-256color for the version with full color support. Using this version, the ipython colors are correct.

Sign up to request clarification or add additional context in comments.

Comments

1

On my terminal (Ubuntu linux) the completion list appears as black text on a gray background. Up/down keys scroll through this, with the current selection appearing on the IN line as well as highlighted with white text on dark gray.

Repeated tab also steps through the list (column by column). Lists that are too long to show on the window has <> edge markings. I can see that > on your screen shot.

I not fully adjusted, but for long lists (e.g. whole os) it is better than the previous less style of paging.

It looks like your terminal color scheme does not handle this gray and dark gray back grounds. I use a default Ubuntu (Mate) terminal with a black on white, but this tab highlighting works the same if I switch to a white on black profile.

My ipython profile includes

c.TerminalInteractiveShell.color_info = True  (default)
c.TerminalInteractiveShell.colors = 'LightBG'

I've played with %colors and profile settings, and can't get rid of the gray background.

So the problem could be in your terminal profile, or in the ipython config settings. I don't know if there's a way of reverting the tab completion back to the previous style.

1 Comment

Hmm, looks like ipython may have some hard coded colors there instead of using stuff like "foreground color" and "background color". I now a few programs, which really ask the user about his background color to be able to display stuff the right way. But most of them work at least with black and white as background colors ...
0

An alternative to using urxvt's reverse video is a custom color palette with these .Xdefaults:

urxvt*foreground: white
urxvt*background: black

*color0:  #2E3436
*color1:  #a40000
*color2:  #4E9A06
*color3:  #C4A000
*color4:  #3465A4
*color5:  #75507B
*color6:  #ce5c00
*color7:  #babdb9
*color8:  #555753
*color9:  #EF2929
*color10: #8AE234
*color11: #FCE94F
*color12: #729FCF
*color13: #AD7FA8
*color14: #fcaf3e
*color15: #EEEEEC

As described in http://bastian.rieck.ru/blog/posts/2013/making_urxvt_beautiful/.

Put them into your ~/.Xdefaults file and activate them via xrdb .Xdefaults. The next time you open an urxvt instance the new colors will be used.

2 Comments

A link to a solution is welcome, but please ensure your answer is useful without it: add context around the link so your fellow users will have some idea what it is and why it’s there, then quote the most relevant part of the page you're linking to in case the target page is unavailable. Answers that are little more than a link may be deleted.
Don't panic, it was easy to edit and include the colorscheme. I did not test it yet, but I assume it is a possible solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.