Ask Your Question
3

Terminal with autocomplete no longer useful

asked 2016-11-30 19:23:57 +0200

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?

edit retag flag offensive close merge delete

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 ( 2016-12-01 17:24:21 +0200 )edit

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 ( 2016-12-02 05:23:26 +0200 )edit

2 Answers

Sort by » oldest newest most voted
5

answered 2016-12-01 14:22:01 +0200

Sébastien gravatar image

updated 2016-12-01 14:37:48 +0200

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
edit flag offensive delete link more

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 ( 2016-12-01 14:46:50 +0200 )edit

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 ( 2016-12-01 14:49:43 +0200 )edit

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 ( 2016-12-01 15:10:58 +0200 )edit

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

kcrisman gravatar imagekcrisman ( 2016-12-01 15:16:48 +0200 )edit

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 ( 2017-01-19 15:08:52 +0200 )edit
1

answered 2016-11-30 21:57:51 +0200

tmonteil gravatar image

updated 2016-11-30 21:59:18 +0200

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...

edit flag offensive delete link more

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 ( 2016-12-01 03:00:12 +0200 )edit

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

kcrisman gravatar imagekcrisman ( 2016-12-01 03:00:51 +0200 )edit

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: 2016-11-30 19:23:57 +0200

Seen: 756 times

Last updated: Dec 01 '16