PowerToys icon indicating copy to clipboard operation
PowerToys copied to clipboard

[Run] Switch to running app instead of opening a new one

Open AtaTrkgl opened this issue 5 years ago • 27 comments
trafficstars

📝 PowerToys Run Auto Focus

PowerToys opens a new instance of an app even if there is an instance. Focusing on that instance instead of opening a new one would be quite handy. Maybe a checkbox for toggling this behaviour?


If you'd like to see this feature implemented, add a 👍 reaction to this post.

AtaTrkgl avatar Aug 14 '20 18:08 AtaTrkgl

You can search for open windows in PT Run.

htcfreek avatar Aug 14 '20 18:08 htcfreek

A toggle for making that function replace the default of opening a new instance is what I am requesting.

AtaTrkgl avatar Aug 14 '20 19:08 AtaTrkgl

this could get quirky i think.

crutkas avatar Aug 14 '20 20:08 crutkas

What if you already have multiple instances running? Which one would be activated?

martinchrzan avatar Aug 15 '20 19:08 martinchrzan

What if you already have multiple instances running? Which one would be activated?

In that case just like how it is right now, we can have multiple buttons for each instance without the new instance button,

AtaTrkgl avatar Aug 16 '20 05:08 AtaTrkgl

Switching to an existing instance instead of opening a new one makes really sense to me. Think about applications like mail programs, browsers, chat programs etc. usually you don't want multiple instance of them and usually you switch to them multiple times a day. further, many applications have tabs, so you don't need a new instance. typing "< name" instead of "name" works, but costs you time. and you need to be aware if an instance is already open or not. as a user, I just want to get the application. That's a little bit like Depdendency Injeciton in programming: I don't care how it is created, I just want to use the service (application). Create a new instance if there isn't one yet, otherwise give me the existing one.

wondering639 avatar Jan 09 '21 13:01 wondering639

This is how alfred works on mac and this feature alone is why I use KeyPiranha

djpeach avatar Jan 26 '21 17:01 djpeach

You can search for open windows in PT Run.

I see than I can go down to find the existing windows, but yeah that is annoying. I would love to have the option at least to open existing windows instead of opening a new one. This is problematic for apps that won't run more than one instance. It just flashes orange in the taskbar, but stays in the background even if i try to use the "open new window" default option.

What if you already have multiple instances running? Which one would be activated?

What Alfred on Mac does, is focus all of them. I've never been bothered by this, and in fact if I have 3 chrome windows open and I do cmd+space, then type "chr" and it pulls them all up over my various monitors, often that is exactly the workflow I needed. I can always just really quickly do cmd+space again and pull up other programs I was using after i am done with chrome, without ever moving my hands from the keyboard.

I am trying to make the long-term switch from mac to windows, and its great to see this super powerful tool being built by microsoft.

djpeach avatar Jan 26 '21 17:01 djpeach

For me, it would be enough if I could configure the WindowWalker plugin to be a higher priority than the Program plugin. I think that should ensure that with the same search text, the "switch to window" action would be the default, instead of having to down-arrow to the bottom of the list:

image

wjbuys avatar Feb 17 '21 00:02 wjbuys

This issue is similar to one already created in the Wox repo: https://github.com/Wox-launcher/Wox/issues/1922.

I'll quote myself, https://github.com/Wox-launcher/Wox/issues/1922#issuecomment-449648777, explaining why suggesting to switching to an activate an application before launching a new instance is more desirable:

With Alfred, to open Spotify I did the following:

  • Opened Alfred (alt + space)
  • Pressed the S-key (s)
  • Pressed enter (enter)

vladdeSV avatar Jun 04 '21 11:06 vladdeSV

This is really a feature I want to have in PT Run from the beginning 👍

I came from ROFI window switch on linux and they are prioritizing the running applications in the search results (at least optional). Furthermore, ROFI has an option for History-based ordering: last 25 choices are ordered on top based on use.

This would be incredible valueable in my daily work, as already pointed out by @wondering639 and @djpeach !

Just a word to differentiate this to #3169: The current filter option does not adress this request here but makes it worth. Let me explain shortly.

The task is easy: Get a Terminal (Outlook, Teams, Chat, Powershell, whatever tool you use frequently) to focus or open it if it wasn't opened already.

Steps with the new feature: 3 Steps for both scenarios (with Terminal already running or not)

  • PTRun shortcut
  • Type "term"
  • Press enter

Steps in PTRun default: 4 Steps

  • PTRun shortcut
  • Type "term"
  • 2x Arrow-Down to select the already running instance
  • Press enter

Steps in PTrun with using the filters: 6 Steps

  • PTRun shortcut
  • Type "<term", filter keyword for running apps is "<"
  • Discover that Terminal is not already running
  • Remove the filter keyword
  • Select Application
  • Press enter

chrobs avatar Jul 05 '21 05:07 chrobs

@crutkas do you see any update here or any chance of getting someone to look into it?

We would really appreciate! Thanks in advance :)

chrobs avatar Jul 12 '21 05:07 chrobs

Copy of my post over at #3169

Hi all

Thanks for the work on this. I too would like this sort of behaviour, and while the option to type < before every search works, I still believe that we should be able to change the priority, the order in which these plugins run.

For example: I have set the activation phrase for Program to a . and I have unset the activation phrase for window walker, however these are still the results I get

image

I would want to have the existing instance show up as opposed to a new instance being created.

This means that the Program plugin is given priority over the Window Walker plugin. As a user, I would want to change this priority.

Could this maybe be reopened as I believe we still haven't achieved the original request, "option to let running programs be first in the results list". @moxwel

Soneji avatar Jul 12 '21 14:07 Soneji

Hi all, @crutkas @enricogior

sorry to bother you, but it is possible to get any hint if this enhancement has any chance of beeing implemented in the near future?

Thanks for your efforts!

chrobs avatar Aug 11 '21 04:08 chrobs

I think that a great way to implement this feature would be to have a "priority" list for all installed plugins. Number one gets first priority, then two, and down the line. Granted, I haven't looked at the codebase to see if implementation is possible, but I think that would be the optimal solution. That way, every user could configure their own order for results.

KnifesmithCode avatar Sep 13 '21 05:09 KnifesmithCode

Is this feature implemented? @AtaTrkgl

vladdeSV avatar May 26 '22 09:05 vladdeSV

Is this feature implemented? @AtaTrkgl

Thought it was but turns out I opened a single-instance app :p

AtaTrkgl avatar May 26 '22 09:05 AtaTrkgl

I missed this feature in macOS and Ubuntu and I came up with this workaround: https://gist.github.com/josephan/cd399794dac11d619f56175d9332f307

Basically you run a powershell function that opens an existing chrome window. If it doesn't exist it creates a new one. It's not very elegant but it beats a cluttered desktop.

josephan avatar Jun 30 '22 03:06 josephan

I found a simpler workaround by increasing the priority of window walker very high, like 1000, causing the first result to be already existing instance instead of new launch

AvatarSenju avatar Sep 04 '23 19:09 AvatarSenju

I think this functionality could be improved by searching for the application name in addition to the text of the title bar. Like if I am searching for Outlook to switch to the open instance of Outlook I have to search for "mail -" and it works, when I search Outlook the window is not found and a new instance will be launched.

TheJoeFin avatar Oct 09 '23 16:10 TheJoeFin

any progress or any better workaround ?

Jackiexiao avatar Mar 04 '24 12:03 Jackiexiao

This should really be implemented. Any updates?

axelthat avatar Mar 29 '24 09:03 axelthat

'Result ordering tuning' tweak is not helpful in my case: 'Application' still appears higher than window with running app. I also want to walk to an already opened window instead of running another one. Maybe it's simpler to suggest tweak for default command in PT Run? So, let it put < every time and I will remove it if it's not required. ☕

Are there any similar issues/enhancements?

e1turin avatar Apr 07 '24 12:04 e1turin

Would also love this feature. Coming back to Windows as a long-time mac power user, I was overjoyed to find PowerToys but really disappointed that it doesn't have this easy refocusing behavior. It's so much easier to open Spotlight/Alfred/a PowerToys Run-style bar, type the first few letters of your desired application and then hit enter to have it refocus it, rather than alt-tabbing through a crowded and hard-to-read list of windows.

leafybees avatar Jul 16 '24 13:07 leafybees

any updates? really searching for this feature on windows :(

gabi-proteantecs avatar Jan 29 '25 07:01 gabi-proteantecs

I found a simpler workaround by increasing the priority of window walker very high, like 1000, causing the first result to be already existing instance instead of new launch

This works. 200 to be exact

kinglau66 avatar Mar 18 '25 05:03 kinglau66

The window search workaround is neat, but the windows don't get icons, and the titles are often hard to recognize (e.g. [Run] Switch to running app instead... vs Firefox)

wavebeem avatar May 19 '25 23:05 wavebeem