in ipython how do I accept and use an autocomplete suggestion?

Question:

I’m using Python 3.8.9 with IPython 8.0.1 on macOS. When I type anything whatsoever, it displays a predicted suggestion based on past commands. Cool.

However, how do I actually accept that suggestion? I tried the obvious: tab, which does not accept the suggestion, but rather opens up a menu with different suggestions, while the original suggestion is still there (see screenshot).

I also tried space, and return, but both of those act as if the suggestion was never made. How the heck do I actually use the ipython autosuggestion? Or is tab supposed to work and something is wrong with my ipython build or something?

enter image description here

Asked By: xdavidliu

||

Answers:

pressing the right arrow key on my keyboard was the only thing that worked. Kind of non-obvious.

Answered By: xdavidliu
Answered By: fnl

Use any key that moves your cursor to the right e.g. END, Right Arrow, CTRL-F, or CTRL-E.

Note that CTRL-F and CTRL-E are simply Emacs’ keys for moving cursor to the right and to the end of the line respectively.

Answered By: off99555
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.