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

Process Model v3 / Tab tear-out ship list #14957

Open
30 of 40 tasks
zadjii-msft opened this issue Mar 6, 2023 · 17 comments
Open
30 of 40 tasks

Process Model v3 / Tab tear-out ship list #14957

zadjii-msft opened this issue Mar 6, 2023 · 17 comments
Labels
Area-Remoting Communication layer between windows. Often for windowing behavior, quake mode, etc. Area-Settings Issues related to settings and customizability, for console or terminal Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Area-Windowing Window frame, quake mode, tearout Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal.
Milestone

Comments

@zadjii-msft
Copy link
Member

zadjii-msft commented Mar 6, 2023

Moving this to separate from #14900. I want that to SPECIFICALLY track tag dragging UX issues (which could apply to us or maybe anyone else using TabView).

For general tab tear-out &U drag drop UX issues, see: ---> #14900 <---

This is a list of things we need to fix to get #5000 / #1256 out the door.

Original PRs:

PR Blockers

We shouldn't even merge these to main like this

PR bugs

Preview Give feedback

Ship blockers

We can merge these, but iterate in post

Follow-ups

Preview Give feedback
  1. A11ySev1 A11yWCAG Area-Accessibility HCL-E+D HCL-WindowsTerminal Issue-Bug Needs-Tag-Fix Product-Terminal
  2. Issue-Bug Needs-Tag-Fix Product-Terminal Resolution-External
  3. Area-UserInterface In-PR Issue-Bug Priority-1 Product-Terminal Severity-Blocking
    zadjii-msft
  4. Area-UserInterface Help Wanted In-PR Issue-Bug Needs-Tag-Fix Priority-2 Product-Terminal
  5. Area-Windowing In-PR Issue-Bug Product-Terminal Severity-Blocking
    zadjii-msft

_windowExitedHandler() would have to be called inside the try clause as a wil::scope_exit

see discussion in #14843 (comment)

Let's just do it in post

In post

Preview Give feedback
  1. Area-Windowing Issue-Bug Priority-1 Product-Terminal Severity-Blocking Tracking-External
  2. Area-Remoting Area-Windowing Issue-Bug Needs-Attention Needs-Tag-Fix Product-Terminal
  3. Area-DefApp Area-Windowing Help Wanted Issue-Bug Product-Terminal

Did we fix it?

Things we may have accidentally fixed on the way?

Fixed?

Preview Give feedback
  1. Area-DefApp Area-Windowing Issue-Bug Needs-Attention Needs-Triage Priority-2 Product-Terminal
@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Mar 6, 2023
@zadjii-msft

This comment was marked as resolved.

@zadjii-msft

This comment was marked as resolved.

@zadjii-msft zadjii-msft added Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Area-Settings Issues related to settings and customizability, for console or terminal Product-Terminal The new Windows Terminal. Issue-Task It's a feature request, but it doesn't really need a major design. Area-Remoting Communication layer between windows. Often for windowing behavior, quake mode, etc. Area-Windowing Window frame, quake mode, tearout labels Mar 7, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs-Tag-Fix Doesn't match tag requirements label Mar 7, 2023
@zadjii-msft zadjii-msft added this to the Terminal v1.18 milestone Mar 7, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot removed Needs-Tag-Fix Doesn't match tag requirements labels Mar 7, 2023
@zadjii-msft zadjii-msft removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Mar 7, 2023
@zadjii-msft zadjii-msft self-assigned this Mar 7, 2023
@zadjii-msft

This comment was marked as resolved.

@ForbiddenEra
Copy link

This is a feature I've been wanting for a while; I'd be happy to give it a test if possible and see if I run into any issues.. However, I'm not quite eager enough to do anything such as building the sources myself. If there's any sort of Beta/RC containing this feature, that'd be great - I already am running the Preview build however.

I do use quite a few screens with multiple dGPUs+iGPU, fancy-zones and such, not sure if my setup would be considered any more trying towards testing (eg. dragging tabs onto other screens, across different GPUs or dropping right into a fancyzone or something - I've seen issues w/other things like browsers handling this in the past though it seems like most of those issues have been solved in those apps)

Otherwise, I'll just thank everyone for their hard work and wait for it to drop and test it then and hopefully not have to report any issues.

:)

zadjii-msft added a commit that referenced this issue Mar 24, 2023
If we get initialized with a window name, this will be called before
XAML is stood up, and constructing a PropertyChangedEventArgs will
throw. So don't.


Regressed in #14843 

Related to #5000, #14957
@zadjii-msft
Copy link
Member Author

Dustin's thing about content

Spawned from this discussion:
#14935 (comment)

Okay, I think I get it. If we can associate the Content directly (or the content tree) with the DataPackage, we no longer need to stash anything. We could probably also completely get rid of ContentIds and ContentManager (!).
Here's why I think that. It looks like you do always get a datapackage or a tab sender. Therefore, you can check the datapackage, read the source window, if it's the same don't detach anything. If it's different, ask the content tree to bubble a detach up to its original hosting window. detach remains driven recipient-side

zadjii-msft added a commit that referenced this issue Apr 4, 2023
Fixes a bug where you'd drag across the boundary and the new window
would be at the wrong size

related to #14957
@DHowett

This comment was marked as resolved.

@DHowett

This comment was marked as resolved.

@zadjii-msft

This comment was marked as resolved.

@DHowett

This comment was marked as resolved.

@zadjii-msft
Copy link
Member Author

MSFT:43995981 - the _checkWindowsForNotificationIcon one

Looking at a dump, the crash is due to a race.

  • A window [A] is created. It lives its life.
  • [A] starts dying.
    • It dtors the AppHost
    • It releases its Logic() member.
  • At this moment, a new Terminal process starts.
    • this causes a ProposeCommandline in the emperor process.
    • This causes the monarch to create a new peasant for the new window.
    • This causes the monarch to raise its _WindowCreatedHandlers.
    • This gets into WindowEmperor::_checkWindowsForNotificationIcon.
    • This takes the _windows lock.
  • Thread A resumes.
    • [A] falls out the bottom of RunMessagePump
    • The cleanup triggers _windowExitedHandler
    • It attempts to lock _windows to remove itself.
  • The RPC thread (that's creating the new peasant) resumes.
    • It tries to get at the _windowThread->Logic(), but oh dear, the AppHost has already dtor'd.

microsoft-github-policy-service bot pushed a commit that referenced this issue Apr 25, 2023
…AppHost (#15231)

See
#14957 (comment).

I think there's a race here that lets the WindowEmperor muck around with
the window after it's done, but before we remove it from our list of
threads.

This _should_ remove the thread from the list, _then_ null out the
AppHost, then flush the XAML queue, preventing the A/V.

Closes MSFT:43995981
microsoft-github-policy-service bot pushed a commit that referenced this issue Apr 25, 2023
…5175)

This bug causes AtlasEngine to render buffer contents with an incorrect
`cellCount`, which may either cause it to draw the contents only
partially, or potentially access the TextBuffer contents out of bounds.

`EnablePainting` sets the `_viewport` to the current viewport for some
unfortunate (and quite buggy/incorrect) caching purposes, which causes
`_CheckViewportAndScroll()` to think that the viewport hasn't changed
in the new window. We can ensure `_CheckViewportAndScroll()` works
by also setting `_forceUpdateViewport` to `true`.

Part of #14957

## PR Checklist
* Tear out a tab from a smaller window to a larger window
* Renderer contents adept to the larger window size ✅

---------

Co-authored-by: Mike Griese <[email protected]>
Co-authored-by: Dustin L. Howett <[email protected]>
zadjii-msft added a commit that referenced this issue Apr 25, 2023
We had a report in a mail thread that someone's Terminal windows were
getting created hidden, and never showing themselves.

As a theory, I'm guessing that dwFlags didn't say that we should
actually use `wShowWindow`. So, to be more correct, let's actually obey
that.

I'm gonna send this package to them to see if it fixes them.

Related to #14957.

Likely regressed in #13838.
zadjii-msft added a commit that referenced this issue Apr 28, 2023
This was in pursuit of #15156. I need an ack from OP to make sure this is good enough.

Related to #14957
zadjii-msft added a commit that referenced this issue Apr 28, 2023
If you were really fast, and closed one window, and then tried to drag the only tab out of the last remaining window, the Terminal could explode. It'd attempt to restore the previous window state, and explode.

Easy way to stop this (also, be more robust): just don't attempt to restore windows during tear-out. That's obvious.

This is a part of #14957
microsoft-github-policy-service bot pushed a commit that referenced this issue Apr 28, 2023
If you were really fast, and closed one window, and then tried to drag
the only tab out of the last remaining window, the Terminal could
explode. It'd attempt to restore the previous window state, and explode.

Easy way to stop this (also, be more robust): just don't attempt to
restore windows during tear-out. That's obvious.

This is a part of #14957
microsoft-github-policy-service bot pushed a commit that referenced this issue May 1, 2023
This was in pursuit of #15156. I need an ack from OP to make sure this
is good enough.

Related to #14957
DHowett pushed a commit that referenced this issue May 8, 2023
This was removed in #14843, but the velocity flag wasn't.

Related to #14957
zadjii-msft added a commit that referenced this issue May 10, 2023
As on the tin.

Blocking for 1.18.

Tracked in #14957
microsoft-github-policy-service bot pushed a commit that referenced this issue May 11, 2023
@zadjii-msft zadjii-msft removed their assignment May 12, 2023
zadjii-msft added a commit that referenced this issue May 12, 2023
Before process model v3, each Terminal window was running in its own process, each with its own CWD. This allowed `startingDirectory: .` to work relative to the terminal's own CWD. However, now all windows share the same process, so there can only be one CWD. That's not great - folks who right-click "open in terminal", then "Use parent process directory" are only ever going to be able to use the CWD of the _first_ terminal opened. 

This PR remedies this issue, with a theory we had for another issue. Essentially, we'll give each Terminal window a "virtual" CWD. The Terminal isn't actually in that CWD, the terminal is in `system32`. This also will prevent the Terminal from locking the directory it was originally opened in. 

* Closes #5506
* There wasn't a 1.18 issue for "Use parent process directory is broken" yet, presumably selfhosters aren't using that feature
* Related to #14957

Many more notes on this topic in #4637 (comment)


> **Warning** 
> ## Breaking change‼️

This will break a profile like 

```json
{
    "commandline": "media-test.exe",
    "name": "Use CWD for media-test",
    "startingDirectory": "."
},
```

if the user right-clicks "open in terminal", then attempts to open that profile. There's some theoretical work we could do in a follow up to fix this, but I'm inclined to say that relative paths for `commandline`s were already dangerous and should have been avoided.
DHowett pushed a commit that referenced this issue May 12, 2023
Before process model v3, each Terminal window was running in its own process, each with its own CWD. This allowed `startingDirectory: .` to work relative to the terminal's own CWD. However, now all windows share the same process, so there can only be one CWD. That's not great - folks who right-click "open in terminal", then "Use parent process directory" are only ever going to be able to use the CWD of the _first_ terminal opened.

This PR remedies this issue, with a theory we had for another issue. Essentially, we'll give each Terminal window a "virtual" CWD. The Terminal isn't actually in that CWD, the terminal is in `system32`. This also will prevent the Terminal from locking the directory it was originally opened in.

* Closes #5506
* There wasn't a 1.18 issue for "Use parent process directory is broken" yet, presumably selfhosters aren't using that feature
* Related to #14957

Many more notes on this topic in #4637 (comment)

> **Warning**
> ## Breaking change‼️

This will break a profile like

```json
{
    "commandline": "media-test.exe",
    "name": "Use CWD for media-test",
    "startingDirectory": "."
},
```

if the user right-clicks "open in terminal", then attempts to open that profile. There's some theoretical work we could do in a follow up to fix this, but I'm inclined to say that relative paths for `commandline`s were already dangerous and should have been avoided.

(cherry picked from commit 5c08a86)
Service-Card-Id: 89180224
Service-Version: 1.18
DHowett pushed a commit that referenced this issue May 12, 2023
Don't go.
Tracked in #14957

(cherry picked from commit 1324a01)
Service-Card-Id: 89180217
Service-Version: 1.18
@ForbiddenEra
Copy link

omgomgomg I just tried tab tear out after a recent update andddddddddd it works!!!!!! finally! so glad to have this feature.

<3 <3 for your hard works!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Remoting Communication layer between windows. Often for windowing behavior, quake mode, etc. Area-Settings Issues related to settings and customizability, for console or terminal Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Area-Windowing Window frame, quake mode, tearout Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

5 participants