Skip to content

Check if neovim is running before executing some commands#282

Merged
MordechaiHadad merged 3 commits into
masterfrom
add/check-if-neovim-is-used
Jun 5, 2025
Merged

Check if neovim is running before executing some commands#282
MordechaiHadad merged 3 commits into
masterfrom
add/check-if-neovim-is-used

Conversation

@MordechaiHadad

Copy link
Copy Markdown
Owner

potentially fixes #278

@matawed

matawed commented Jun 5, 2025

Copy link
Copy Markdown

can confirm that this fixes the problem in #278

image

@MordechaiHadad

Copy link
Copy Markdown
Owner Author

awesome, please let me know if the issue this persists

@MordechaiHadad MordechaiHadad merged commit 96fb209 into master Jun 5, 2025
52 of 53 checks passed
@MordechaiHadad MordechaiHadad deleted the add/check-if-neovim-is-used branch June 5, 2025 11:05
@matawed

matawed commented Jun 5, 2025

Copy link
Copy Markdown

However, I'm not sure if it should be addressed like that, I mean you can e.g. replace a file but all processes which still have a handle on that still can continue, so I'm not sure why this check was actually introduced.

@MordechaiHadad

Copy link
Copy Markdown
Owner Author

However, I'm not sure if it should be addressed like that, I mean you can e.g. replace a file but all processes which still have a handle on that still can continue, so I'm not sure why this check was actually introduced.

Sure it is only possible to do so on linux though and i can potentially find a way to do this via rust, but its not possible on other platforms and id rather keep the handling of different platforms in bob rather minimal.

@griwes

griwes commented Jun 8, 2025

Copy link
Copy Markdown

I understand why this has been done, however, most of my terminals and daily updates... are inside neovim terminals, which means that I now also have to quit all of them to update neovim 🙃 Would you accept a PR that adds an explicit option to update without making this check?

@taketwo

taketwo commented Jun 10, 2025

Copy link
Copy Markdown

adds an explicit option to update without making this check?

I'd very much appreciate such an option. I typically have dozens of Neovim instances running scattered across many Tmux sessions. After this PR, I have to chase down and quit each Neovim instance before I can update to the newest nightly. This is very inconvenient and disruptive.

@MordechaiHadad

Copy link
Copy Markdown
Owner Author

Hmmm so you want this only for the update command?

@taketwo

taketwo commented Jun 18, 2025

Copy link
Copy Markdown

Yes, lifting this requirement from the update command would unbreak my Neovim version management routine. That said, from the UX consistency perspective, it would be nice if commands like bob use nightly or bob rollback also do not complain about running instances. So, basically, remove this check from all commands that manipulate the executable on Linux.

By the way, there is something else I've noticed about this check. I have a host Ubuntu system and a long-lived Docker container with another Ubuntu inside that I use for some development work. I have bob+neovim both on the host and in the container. Apparently, when bob update does the check on the host, it picks up processes from the container as well. For example, if there are no Neovim instances running on the host, but there is one instance inside the container, bob update on the host complains about "Neovim is currently running". Note that host/container do not even share the same Neovim executable through volume mapping. These are indeed different files on different filesystems.

@fent

fent commented Aug 4, 2025

Copy link
Copy Markdown

Can you please make this optional? I use bob to test different versions of neovim for plugins I develop, and like many here, I keep several neovim instances open across several tmux windows, panes, and sessions. I just updated bob and ran into this, so I downgraded to v4.0.3.

@MordechaiHadad

Copy link
Copy Markdown
Owner Author

#305

Lets move it this issue, give me an illustration of how you would guys want it implemented, how to enable, what commands etc.

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 this pull request may close these issues.

"bob use v0.11.1" exits with error and reports "The file /home/xxxxx/.cargo/bin/bob is busy. Please make sure to close any processes using it."

5 participants