First time here? Check out the FAQ!

Ask Your Question
3

Terminal with autocomplete no longer useful

asked 8 years ago

kcrisman gravatar image

See the following screenshot.

image description

Tab-completion in the Mac terminal is no longer useful, because there is no way to scroll down to see the rest of the options. I don't know when this change came in but I have a beta of 7.4. I assume that we are either using IPython differently, or that it changed itself. Can anyone help? Or is this simply a bug?

Preview: (hide)

Comments

1

It displays as many completions as it can fit in the window, so it helps to make the terminal window bigger or to start at the top of that window. If you hit ctrl-L while the list of completions is visible, it will clear the screen and therefore show you more completions.

John Palmieri gravatar imageJohn Palmieri ( 8 years ago )

Thanks for that comment - I tend to not make the windows bigger unless I'm going to be working for a while in it, but that is good to know.

kcrisman gravatar imagekcrisman ( 8 years ago )

2 Answers

Sort by » oldest newest most voted
5

answered 8 years ago

Sébastien gravatar image

updated 8 years ago

Check if you already have the files

profile_default/ipython_config.py
profile_default/ipython_kernel_config.py

inside the folder given by the command sage -ipython locate. If you do not have those files, the following commands creates them:

sage -ipython profile create

In the file profile_default/ipython_config.py, uncommenting the following line:

c.TerminalInteractiveShell.display_completions = 'readlinelike'

will give the tab completions as before! Or if you like the new multicolumn, you can increase the number of rows from 6 to 30:

c.TerminalInteractiveShell.display_completions = 'multicolumn'
c.TerminalInteractiveShell.space_for_menu = 30

While you are there, you may also want to set the default color properly:

# Set the color scheme (NoColor, Neutral, Linux, or LightBG).
c.InteractiveShell.colors = 'Linux'     # Linux is for dark background
Preview: (hide)
link

Comments

Amazing, i was going to edit my answer into those lines ! All options can be found here : http://ipython.readthedocs.io/en/stab... and indeed, we can/should add something into the Sage documentation about that.

tmonteil gravatar imagetmonteil ( 8 years ago )

Regarding the colors, note that it also depends on the type of terminal. I personally had some issues with urxvt and none with xterm.

tmonteil gravatar imagetmonteil ( 8 years ago )

Wow, this is great and definitely should be added to documentation. I think that once I had those type of files but in a long-ago version of ipython. Thank you! Sorry, @tmonteil, this answer is better ;)

kcrisman gravatar imagekcrisman ( 8 years ago )

Only note that the 'readlinelike' isn't one I can uncomment, had to do it by hand.

kcrisman gravatar imagekcrisman ( 8 years ago )

There is a problem with this solution - what happens if your IPython is upgraded? I just found out that then I have to start over from scratch ... surely there is some profile not in the .sage folder?

kcrisman gravatar imagekcrisman ( 8 years ago )
1

answered 8 years ago

tmonteil gravatar image

updated 8 years ago

I also find that annoying, and it is not specific to mac. You can still move along the choices with up/down arrows or TAB/SHIFT+TAB keys. To what i understood, it appeared when ipython moved from readline to prompt_toolkit, fancier, but less handy :(

Indeed: http://ipython.readthedocs.io/en/stab...

Preview: (hide)
link

Comments

"The overhaul of the terminal interface will probably cause a range of minor issues for existing users." Yup. I also can't see anything under my cursor - in particular, I have autocompleting parentheses from another thing (on purpose) and forget to not complete them because I can't see the second paren.

kcrisman gravatar imagekcrisman ( 8 years ago )

So ... maybe we should update the documentation somewhere?

kcrisman gravatar imagekcrisman ( 8 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 8 years ago

Seen: 952 times

Last updated: Dec 01 '16