4

IPython 8.5.0. doesn't properly scroll my history when using up/down arrow keys. Yet, the %history command still gives me the proper history. Furthermore, "search previous command history" also still works. I have had these issues ever since I upgraded IPython from 7.15.0. to 8.5.0..

Example:

In [1]: x = 1                                                                                                                                                                                                                                                                                                                                                                                                                            

In [2]: y = 2                                                                                                                                                                                                                                                                                                                                                                                                                            

In [3]: %history                                                                                                                                                                                                                                                                                                                                                                                                                         
x = 1
y = 2
%history

If I now press the up-arrow (or CTRL+P), IPython cycles through some old code (seemingly random at each restart of IPython). However typing x and up-arrow will result in the historical x = 1 statement. I want the up-arrow without typing anything to give me the last used statement.

up-arrow used to work for me in version 7.15.0., but now the issue persists for versions 8.2.0. until 8.5.0.. Is this just a change for the newer IPython versions?

All versions were installed on Ubuntu 20.04.5 LTS with pip 22.2.2. I installed readline version 6.2.4.1 .

Any help would be much appreciated.

  • I am having the same issue. Could this be related to the `LXterminal` as in here https://github.com/ipython/ipython/issues/10984 ? – dresio Sep 27 '22 at 14:30

1 Answers1

1

This was an issue in prompt-toolkit; IPython 8.7.0 and above pin to a newer version that fixes this issue.

Beau
  • 111
  • 3
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 02 '23 at 09:55