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

wezterm start launches in background on macOS #6202

Open
goerz opened this issue Sep 28, 2024 · 2 comments
Open

wezterm start launches in background on macOS #6202

goerz opened this issue Sep 28, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@goerz
Copy link

goerz commented Sep 28, 2024

What Operating System(s) are you seeing this problem on?

macOS

Which Wayland compositor or X11 Window manager(s) are you using?

No response

WezTerm version

20240922-151228-2b76c63b

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

Yes, and I updated the version box above to show the version of the nightly that I tried

Describe the bug

When starting WezTerm by issuing the command

wezterm start --always-new-process

(or even just wezterm start, and also if using wezterm-gui), the window that opens is in the background:

CleanShot.2024-09-28.at.11.53.00.mp4

This happens whether issuing wezterm start from another terminal, or via any other way of running a command (a shell script inside a Keyboard Maestro macro, in my case). The only way to start WezTerm in the foreground is to open the WezTerm.app.

To Reproduce

Open the macOS built-in Terminal app.

Run

wezterm start --always-new-process

Configuration

no config

Expected Behavior

A new WezTerm GUI app instance should appear, active and in front of my existing windows (as if I had launched the WezTerm.app in the GUI)

Logs

> $HOME/Downloads/WezTerm-macos-20240922-151228-2b76c63b/WezTerm.app/Contents/MacOS/wezterm start --always-new-process
2024-09-28 10:29:39.581 wezterm-gui[67603:8842169] +[IMKClient subclass]: chose IMKClient_Legacy

Anything else?

I came across something similar recently in neovide/neovide#2330, and the resolution there – using the deprecated -[NSApplication activateIgnoringOtherApps:] API – might be applicable here as well.

In fact, this issue with WezTerm came up while trying to set it up as a wrapper for neovim. I'd be interested in any workarounds for a background shell script running something like

/opt/homebrew/bin/wezterm-gui --config-file $HOME/.config/wezterm/neovim.lua start --always-new-process -- /opt/homebrew/bin/nvim "$FILE"

and having that WezTerm window appear in the foreground.

@goerz goerz added the bug Something isn't working label Sep 28, 2024
@goerz
Copy link
Author

goerz commented Sep 28, 2024

There does seem to be a possible workaround, which I tried on a lark:

open -n -W -a $HOME/Downloads/WezTerm-macos-20240922-151228-2b76c63b/WezTerm.app --args --config-file $HOME/.config/wezterm/neovim.lua start --always-new-process -- /opt/homebrew/bin/nvim

@goerz
Copy link
Author

goerz commented Sep 28, 2024

The workaround does indeed work, see the neovim wrapper in my configuration. So this doesn't seem like a high-priority issue, but still buggy behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant