flyingpie / windows-terminal-quake

Turn any app into a Quake-style toggleable app.
https://wtq.flyingpie.nl
MIT License
573 stars 38 forks source link

Reworked how new app instances are created #131

Closed flyingpie closed 2 months ago

flyingpie commented 4 months ago

Previously, we ran a background worker, that continuously goes through the list of configured apps, and checks whether there's a process running that we can attach to.

(Ignoring the "AttachMode" setting for now, assuming the default of "FindOrCreate").

There's a couple issues with this:

A known case of the latter, is when Windows Terminal is configured as the default console host, and we're trying to start an instance of PowerShell. WTQ may look for conhost.exe, but it will be gone, as the window has been taken over by Windows Terminal, usually as a tab. This results in an infinite loop of adding tabs to Windows Terminal, where WTQ thinks the process failed to start.

This PR changes the behavior, such that attaching to a process (which can include starting one) is done in response to specific events. Namely, when a hot key is pressed, and when WTQ starts.