-
Notifications
You must be signed in to change notification settings - Fork 501
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
neovide does not focus on launch from terminal (macOS, iTerm2) #2330
Comments
related #2324 |
I noticed this issue start to occur after updating when using Raycast. After updating Neovide when Neovide is launch from Raycast it starts in the background. I am able to work around this by including this in my vim.schedule(function()
vim.cmd "NeovideFocus"
end) |
For me, this is also the case. Launching from Finder results in the same behavior, even with all plugins disabled. Scheduling EDIT: Launching from kitty / Terminal.app works just fine! |
Seeing same behavior from iTerm2 as described above. Also note that when launching from Spotlight, the neovide window is focused, but is appended to the end of the cmd-tab switcher (same as described above when launching from a terminal), which is the opposite of most macOS applications. The focus+stacking issue is likely separate from the cmd-tab issue. |
I can reproduce it as well. It gets focused properly when launched from Raycast or Launchpad (after symlinking from /opt/homebrew/Cellar/neovide/* to $HOME/Applications) but doesn't focus up when starting from WezTerm nor iTerm2 UPDATE1: UPDATE2: It has something to do with how macOS handles CLI binaries vs Neovide.app files. Launching
|
I did some digging about this and looks like it is general macOS problem/default behaviour. For example when launching wezterm from terminal it behaves the same way as neovide does. My current workaround for it:
|
FWIW, adding a delay before calling if exists('g:neovide')
autocmd VimEnter * call timer_start(20, {tid -> execute('NeovideFocus')})
endif This seems like a fairly effective workaround while the application itself doesn't currently request focus on startup. |
Works great! Here is Lua version: if vim.g.neovide then
vim.defer_fn(function()
vim.cmd("NeovideFocus")
end, 25)
end |
I have a potential fix for this here: It would be good if someone could test it. |
@fredizzimo I'm unfortunately still seeing this after #2562, with a locally built neovide. I'm also seeing the same behaviour as @nazriel, the issue only happens when running If it helps, Alacritty doesn't have this problem and they're also using winit afaik. |
Ok, I will re-open this. The list bugs that PR fixed was more of a wishlist than scientific proof, based on the winit documentation:
|
Describe the bug
I launched
neovide
from iTerm2 and it launched behind the iTerm2 window and all the way at the end of the app switcher. (I had been doing something where I had set neovide to be on the right side of the screen the same as my typical iTerm2 window, and I kept it here because it shows the behaviour fairly well.)Even adding
vim.cmd("NeovideFocus")
to the end ofinit.lua
is not fixing the issue.To Reproduce
Steps to reproduce the behavior:
neovide
in iTerm2 (this probably happens with Terminal.app as well, but I currently use iTerm2).Expected behavior
Neovide should take focus (especially if
vim.cmd("NeovideFocus")
is ininit.lua
orNeovideFocus
is ininit.vim
) from iTerm2 and be positioned in front of iTerm2.Screenshots
Desktop (please complete the following information):
Please run
neovide --log
and paste the contents of the.log
file created in the current directory here:neovide_rCURRENT.log
Additional context
Add any other context about the problem here.
n/a
The text was updated successfully, but these errors were encountered: