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

Mac: reload from the same window that started the process, if possible #39

Open
arthurspa opened this issue Sep 18, 2023 · 3 comments
Open

Comments

@arthurspa
Copy link

Hi, I have the following scenario:

  • monitor 1 (M1) running VSCode
  • monitor 2 (M2) running zsh, where I call gow run .

Desired behaviour:
First time the app is loaded on M2, then when I change the focus to M1 and update the code, gow will reload the app in M2.

Current behaviour:
First time the app is loaded on M2, then when I change the focus to M1 and update the code, gow will reload the app in M1

The reason why I want this is to be able to keep editing the code in VSCode in full screen and watch the changes at the same time.
Currently it switches to the app on reload and moves away from VSCode. So I have to switch back at each save.

I don't know if it's possible, maybe it's a Mac behaviour. But checking anyway.

@mitranim
Copy link
Owner

monitor 2 (M2) running zsh, where I call gow run .

Requires clarification: running how? Via Terminal / iTerm2 / another VSCode window / something else?

when I change the focus to M1 and update the code, gow will reload the app in M1

Requires clarification. It was running on M2 (how?). Does the entire window get moved between monitors?

I use MacOS with one physical display, so I can't test this. I've heard horror stories about multi-monitor behaviors on MacOS. For now, I can tell you is that gow does absolutely nothing that should cause apps to change focus or move between displays or workspaces. This kind of stuff doesn't happen when using a single display.

@arthurspa
Copy link
Author

arthurspa commented Sep 19, 2023

Requires clarification: running how? Via Terminal / iTerm2 / another VSCode window / something else?

On M2 (display 2) I'm running go run . in apple Terminal, with tmux v3.3a

Requires clarification. It was running on M2 (how?). Does the entire window get moved between monitors?

When I move the focus to M1 (display 1) to work on VS Code window, then gow run . is still running on my Terminal in M2 (display 2). No, not the entire Terminal gets moved to M1, just the app window that is reloaded by the running gow run .

@mitranim
Copy link
Owner

If your Go app opens its own GUI window, you should probably clarify this, since it's uncommon for Go apps. When gow restarts it, does the system reopen the window on the "current" monitor? I haven't experienced this issue because I haven't used multiple monitors. It might be possible to pin an app to a specific monitor, just like with virtual desktops / workspaces (right click in Dock → Options). But I'm sure you've already tried that...

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

No branches or pull requests

2 participants