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

Force activate existing windows when running a commandline in them #9137

Merged
5 commits merged into from
Feb 17, 2021

Conversation

zadjii-msft
Copy link
Member

@zadjii-msft zadjii-msft commented Feb 12, 2021

This will make sure to summon the terminal window when running a
commandline in it.

  • If the window is on another desktop, the OS will switch to the desktop
    the window is on.
  • If the window is minimized, it will restore it.

This is taken from my quake mode branch. It works aggressively. 848682a,
fee6473, 342d3f2, 5052d31 all had other attempts at doing this, but they
didn't work reliably. Part of the trick is that I don't think Windows
wants one process to be able to move another process into the
foreground. In this case though, we do want to move ourself into the
foreground, and this AttachThreadInput hack seems to be the only way
to do it reliably.

References #5000
Uses code authored for #653

Closes https://github.com/microsoft/terminal/projects/5#card-54636373

@zadjii-msft zadjii-msft added Issue-Bug It either shouldn't be doing this or needs an investigation. Area-User Interface Issues pertaining to the user interface of the Console or Terminal Product-Terminal The new Windows Terminal. labels Feb 12, 2021
@github-actions

This comment has been minimized.

@DHowett
Copy link
Member

DHowett commented Feb 17, 2021

Horrified that this works. Wow.

@DHowett DHowett added the AutoMerge Marked for automatic merge by the bot when requirements are met label Feb 17, 2021
@ghost
Copy link

ghost commented Feb 17, 2021

Hello @DHowett!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit 847749f into main Feb 17, 2021
@ghost ghost deleted the dev/migrie/f/ACTIVATE branch February 17, 2021 21:37
@ghost
Copy link

ghost commented Mar 1, 2021

🎉Windows Terminal Preview v1.7.572.0 has been released which incorporates this pull request.:tada:

Handy links:

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants