Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipython 8.2.0 mixing history from multiple ipython sessions #13631

Closed
segasai opened this issue Apr 10, 2022 · 8 comments · Fixed by #13834
Closed

ipython 8.2.0 mixing history from multiple ipython sessions #13631

segasai opened this issue Apr 10, 2022 · 8 comments · Fixed by #13834
Milestone

Comments

@segasai
Copy link

segasai commented Apr 10, 2022

Hi,

After updating to ipython 8.2.0 I observe a very annoying behaviour, when pressing 'UP_ARROW' in long running ipython session brings not the previous command from history, but a command from some other ipython session running concurrently.

How to reproduce.

  • Start ipython session 1
  • Start ipython session 2
  • Type x=1 in session 1
  • Type y=1 in session 2
  • Type x=2 in session 1
  • Type y=2 in session 2
  • Now in session 1 press 'UP_ARROW', and it will bring y=1 instead of x=2

This is very inconvenient behaviour that completely breaks the workflow in long running ipython sessions. I assume it must be a regression.

Thank you.

(I'm using python 3.8 with the latest prompt-toolkit 3.0.29 on linux (ubuntu 18.04)

@segasai
Copy link
Author

segasai commented Apr 10, 2022

I have just checked that this was caused by the #13592 as the problem didn't occur before it.

@ljames8
Copy link

ljames8 commented Apr 12, 2022

Hi
I have the exact same issue on macOS 12.1 with python 3.9.10 and prompt-toolkit 3.0.8

@anwarnunez
Copy link

This issue is indeed very inconvenient. I'm not sure the current behaviour is ever desirable.

Carreau added a commit to Carreau/ipython that referenced this issue Apr 29, 2022
It forces get_tail to put the current session last in the returned
results.
Carreau added a commit to Carreau/ipython that referenced this issue Apr 29, 2022
It forces get_tail to put the current session last in the returned
results.
Carreau added a commit that referenced this issue Apr 29, 2022
This fixed the mixing of multiple history seen in #13631
@Carreau Carreau added this to the 8.3 milestone Apr 29, 2022
@Carreau
Copy link
Member

Carreau commented Apr 29, 2022

closed by #13657

@Carreau Carreau closed this as completed Apr 29, 2022
@hristog
Copy link
Contributor

hristog commented Sep 12, 2022

I'm still experiencing this issue on: IPython 8.5.0 (and the versions all the way down to 8.2.0, inclusive), and Python 3.8.5.
I've had to downgrade to IPython 8.1.0, in order to have the up-arrow-key history functionality work properly.

@harenbrs
Copy link

@hristog Can confirm, seeing the same on IPython 8.5.0:

Python 3.8.6 (default, Nov  9 2020, 16:24:25) 
Type 'copyright', 'credits' or 'license' for more information
IPython 8.5.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: 42
Out[1]: 42
                                                                                                                                                                            0.013377s
In [2]: %history
42
%history
                                                                                                                                                                            0.000982s
In [3]: X('year').get_previous_start_time(dt)  # up-arrow

@hristog
Copy link
Contributor

hristog commented Sep 21, 2022

Thanks for reproducing and confirming the issue, @harenbrs!

@derVedro
Copy link

same with IPython 8.6.0, fixed it by updating old promt_toolkit (3.0.5) to the latest one (3.0.32)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants