rfvgyhn / min-ed-launcher

Minimal Elite Dangerous Launcher
MIT License
251 stars 9 forks source link

feature request: bring windows terminal window to front when the game exits, and relaunch mode is active #79

Open slippycheeze opened 1 year ago

slippycheeze commented 1 year ago

I'm on Windows 11, steam, start command is cmd /c "MinEdLauncher.exe %command% /autorun /edo /restart 20", running v0.7.5. min-ed-launcher is run inside a windows-terminal window.

When ED exits focus is often on a different window. Perhaps because I've clicked on my EDMC windows to interact, or alt-tabbed to a web browser, perhaps just because windows is sadistic. Regardless, the EDMinLaunch windows-terminal window isn't focused.

You can bring it to the foreground by executing this command: wt -w 0 focus-tab -t -1 -w 0 is "current window", -t -1 is "tab minus one", which is as close as possible to "whatever tab is currently focused.

That should bring the window to the foreground and make interacting with min-ed-launcher again easy; to determine if you are actually running in windows-terminal you can check for the WT_SESSION or WT_PROFILE_ID environment variables.

FWIW, I don't really care if this is solved portably, in the sense of other shells, and I'm OK with the idea of writing my own little powershell monitor script to launch in the background and have watch for process start and exit events, then do the focus shifting, but ... feels like something that would be nice to have™ in the launcher.