-
-
Notifications
You must be signed in to change notification settings - Fork 637
[Bug]: wrong item selected from history #2704
New issue
Have a question about this project? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “No 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? No Sign in to your account
Comments
I've been seeing behavior like this the past few weeks, also intermittently. From my experiments, it seems like any time I select the same history entry, I get the same behavior - if selecting an entry gives me the wrong command, selecting that entry always gives me the (same) wrong command. |
Yes, I met exactly the same, very annoying. My current temp solution is to open a new terminal tab and then select the same history entry in the new tab. |
Downgrading to 18.4.0 also doesn't fix this issue, so I assume the db itself has been written incorrectly. |
A few questions to help narrow this down and reproduce
|
If anyone who can reproduce this issue is able to test #2706, I would really appreciate it! |
was able to reproduce today, but then it got missing.
consider that my full history is:
Changing to another directory -- this problem goes away, returning to the dir -- problem comes back.
I ran
|
are there pre-built artifacts available to try? |
I'm having the same issue. My far fetched guess is that my multiple terminals are syncing, and then, the history in older terminals loses sync with history indexes. When this issue happens to me I'm usually working on two different terminals side by side. After a while, the older terminal begins having the issue. Now, if I open a new terminal, the issue is gone. I'll post a video the next time it happens. Also, I'm going to try #2706. |
I can't trivially run our release pipeline on that branch + github doesn't let me upload binaries to an issue, but you can install the code from that branch with:
I was wondering the same. The changes in that branch couple what is displayed with what is selected more closely, so hopefully that doesn't happen. It's difficult for me to be sure without being able to replicate it, though. |
I think it's still happening for me even with #2706 -- I was able to get a video, it's attached. Seems like it only happened for some entries though -- one reliably selected the wrong item, others were still right. atuin-wrong-item.webmHappy to try anything that might be helpful in narrowing this down. |
Thank you for the video! Does it happen if you type slower? And generally slower inputs And does it happen on 18.3? |
Attached another video with a brief pause before hitting enter -- doesn't seem to make a difference. atuin-wrong-item-slower.webm |
Thanks! One more input q; if you type to filter, then press the up arrow followed by the down arrow, and then select - does it still happen? basically want to check if this is hiding within the search logic only, or if it also affects scrolling |
Scrolling up and down before picking doesn't seem to make a difference. atuin-wrong-item-up-down.webm |
ok, thanks for all the info! lmk if it still occurs with 18.3 and i can dig through the diffs. |
will do. fwiw it feels like it just started recently (maybe with 18.5) -- I hadn't noticed it before this week, but seems like it's like 2-3 times a day now in different contexts across different machines. |
To clarify my earlier comment regarding 18.4.0 -- downgrading seems to prevent the issue from occurring on new entries, as devusb said, but it doesn't seem to fix entries that are already broken, at least immediately. |
Ohhh interesting. If you're affected by this, could you let me know what shell you're using please? output of Otherwise @octylFractal - does downgrading and then running |
With #2706. Still happening. atuin-issue.webm |
With which shell? |
{
"atuin": {
"version": "18.5.0",
"sync": {
"cloud": true,
"records": true,
"auto_sync": true,
"last_sync": "2025-04-20 17:55:54.576626153 +00:00:00"
},
"sqlite_version": "3.46.0"
},
"shell": {
"name": "zsh",
"default": "zsh",
"plugins": [
"atuin"
],
"preexec": "built-in"
},
"system": {
"os": "Arch Linux",
"arch": "x86_64",
"version": "rolling",
"disks": [
{
"name": "/dev/nvme0n1p2",
"filesystem": "ext4"
},
{
"name": "/dev/nvme0n1p4",
"filesystem": "ext4"
},
{
"name": "/dev/sdc1",
"filesystem": "xfs"
},
{
"name": "/dev/sdb1",
"filesystem": "xfs"
}
]
}
} |
Im on atuin 18.5.0 |
|
I hit the bug again, and tried #2715, and it seems to fix it. I did an |
This is happening for me too. atuin doctor
This comment from a user above matches my experience 100%:
As I scrolled through these comments... I tried Quote from @octylFractal's comment yesterday --
I also use Oh My ZSH, and I just ran Importantly -- I am NOT using the #2715 patch. I am still on regular v18.5. Very odd! Hope this helps... |
Thanks @curtisbelt! So far it does seem to be only zsh users, and potentially even omz. Does suggest that #2715 might resolve it. Are you able to test the patch?
|
I was also encountering this bug and came across this issue and macOS 15.4.1 |
So I noticed that in another iterm window it did not fix it even after running I'm also using I will also now install the patch to see if that resolves the issue. |
I installed the patch yesterday, one day through will all (oh-my)-Zsh sessions opened anew, I observe no problems. |
@ellie I have the patch installed, but unfortunately, I ran into the bug again yesterday evening. I had been using the terminal (and atuin) throughout the day without seeing the bug until then. I can't think of any reason why the bug appeared again, as far as my usage pattern goes I was doing the same things I was always doing (hitting up arrow, search, hit enter to select... or hitting up arrow a couple times for recent entry, then hit enter to select) Nothing special.
|
Thanks for letting me know! Is there any chance that it occurred in a shell session that hadn't been restarted since installing the patched version? |
@ellie I wish that was the case! I can rule that out completely as I've restarted my computer between installing the patch and seeing the bug. For good measure I just ran this again:
which confirms it's installed. |
I also have the patch installed and encountered the issue again and then resolved it using |
@ebartels @octylFractal @monyxie @nokernel |
@curtisbelt if i could also get the output of
just to rule out anything weird going on If it still replicates after the patch, and still replicates on 18.3, then I'm wondering if something might have changed with omz recently. We haven't made any major changes to the zsh plugin or the interactive search in a long time, so it's strange that things aren't working now |
After upgrading to build from #2706 and reloading omz don't recall seeing this bug, also using Ghostty, but v 1.1.3. |
@curtisbelt im on plain zsh 5.9 not using oh my zsh. Terminal is iterm2 |
I have been hitting this as well. One data point, I don't have direct evidence, but i feel like it happens more if I run commands on different terminals.
self hosted atuin server
|
@ellie Here's that output you asked for: atuin init zsh
I think you may be right... I need to test more, but I downgraded
and the bug still occurred, HOWEVER, I then I downgraded further back to...
and I could NOT reproduce it anymore! (and I've gotten good at reproducing it within 1-2 minutes) I will work on this more in the morning... I think the bug may be caused by something in-between that commit range! I'm hoping so 😎 |
Kitty 0.41.1 on Fedora Linux |
I'm using Terminator 2.1.4 on KDE Plasma. |
I'm able to 100% replicate this: atuin2704.webm |
@monyxie Really nice find... I'm also getting 100% reproduction with your steps. Peek.2025-04-26.03-33.webm@ellie I am sad to report that downgrading And This is so strange 😢 let me know if there's anything else I can do! |
I did some more testing.
I then ran a bisect and it pointed to this commit.
|
I'm unable to reproduce your fix. Can you let me know if I've done this correctly?
I am on the latest |
@curtisbelt Can you run this command and try to reproduce the bug again?
Also, just to make sure the |
Restarted terminal. Could still reproduce the bug. Then I ran Okay it turns out my atuin has never actually changed from v18.5.0
That hash is the tagged v18.5.0 commit in atuin repo... ok, going to look into why my binary isn't changing. I'm pretty sure I originally installed atuin using the recommended command |
The cargo command should show you the path to the
You need to make sure that directory is in your PATH and precedes |
@monyxie I got it fixed! I can no longer reproduce the bug! 🥳
Adding the
That's the correct hash from my fork 👍🏻 @ellie Apologies for not realizing my binary wasn't actually changed all this time! Looks like @monyxie and I are both confirmed cases of solving this bug with this very small patch: main...curtisbelt-forks:atuin:zsh-select-bug (credit to @monyxie for figuring that out). |
What did you expect to happen?
macOS 15.4.1 and atuin 18.5.0
when I press ctrl+r to find history, select item from history wrong item is pasted to the command prompt.
Can't always reproduce. Usually I do this quickly, ctrl+r, select what I need (by searching, etc) and press enter.
Few times noticed, wrong command was pasted into prompt from history.
This happened on at least two occasions just today, which already drove me a bit crazy. When specifically tried, can't reproduce.
What happened?
Wrong record was pasted into command prompt from history. let's say I wanted to select line from history where I meant to rerun command to copy file, but instead rm -rf /path which I didn't mean to delete was run.
Atuin doctor output
Code of Conduct
The text was updated successfully, but these errors were encountered: