microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
94.36k stars 8.17k forks source link

Terminal windows opened from Windows Explorer via double click cannot join with existing terminal sessions #15509

Open Mersid opened 1 year ago

Mersid commented 1 year ago

Note: 📌 Pinned comment: https://github.com/microsoft/terminal/issues/15509#issuecomment-1592021826


Windows Terminal version

1.18.1462.0

Windows build number

10.0.19045.3031

Other Software

Any program that spawns a terminal window

Steps to reproduce

When the default terminal application is set to the Windows Terminal (preview, in this case), programs, such as servers, that open a terminal window will have windows whose tabs cannot join with regular terminal windows.

Expected Behavior

Any instance of Windows Terminal may join into any other window.

Actual Behavior

The spawned terminal window will not be able to join with an existing terminal group. The "Move" popup does not appear, and the tab will not join into the existing window.

237dmitry commented 1 year ago

Double clicking opens the application in the default console. If default:

Windows Terminal Conhost Let Windows decide
Windows Terminal (new tab) conhost conhost

"windowingBehavior": "useExisting"

WT: 1.18.1462.0 Win 11 22H2

Mersid commented 1 year ago

My apologies, I do not understand?

zadjii-msft commented 1 year ago

Are you running the Terminal as Admin/?

Terminal (stable) windows can't be merged with Terminal Preview windows. There is one report we've had in the past about Preview\<->Preview communication not working, though that was a very rare edge case

Mersid commented 1 year ago

No, I am not running Terminal as admin.

237dmitry commented 1 year ago

I do not understand?

Read this

Mersid commented 1 year ago

Thanks for the suggestion. I tried that, and unfortunately it does not appear to work. The issue still persists :(

carlos-zamora commented 1 year ago

Hi @Mersid.

DHowett commented 1 year ago

Oh no. Ohhh, noooo.

This is definitely broken in 1.18. Instances of Terminal started for -Embedding don't seem to glom with other instances of Terminal.

Mersid commented 1 year ago

Hello, @carlos-zamora

The current non-preview version of Windows Terminal (for me) is 1.17.11461.0, and does not support the drag'n'drop feature yet.

zadjii-msft commented 10 months ago

Wait @DHowett can you actually repro this?

I've been futzing with this all morning and can't get a repro locally with a dev build[^1]. I can't do it with a Terminal-first cold launch, or a cmd.exe(defterm)-first cold launch. And I can't repro it via #15518 either.

I'm moving this to @DHowett to try and fix. Or close as fixed along the way of 1.19[^2].

[^1]: Admittedly, I did spend a few hours on #15238 and the associated "blow away a dev build to fix a bad defterm registration". But once I got dev build defterm working again, then I haven't had any troubles with this. [^2]: There's maybe a small chance that #15424 fixed this? but that seems unlikely.

krzysdz commented 10 months ago

@zadjii-msft If this is the same problem as #15636 then it definitely isn't fixed and I can reproduce it with the latest build (d54ce33afcd5e9875b53e4449ea3d2fd5c1ebc07 / 636be7e514e243810e8944a61f5cf7044d316e05).

DHowett commented 10 months ago

I can't reproduce it in 1.19, but I do not know whether that is because it doesn't reproduce on this machine or because it is fixed in 1.19.

bracco23 commented 8 months ago

tried reproducing #16189 to get some traces to share here but when i tried on my home pc (same setup, just win 11 instead of win 10), it didn't repro. So this is possibly some quirk of win 10 that got fixed on win 11. Sorry, i'm probably not allowed to share traces from my work PC so can't give any more info.

krzysdz commented 8 months ago

this is possibly some quirk of win 10 that got fixed on win 11.

I've just tried repeating #15636 in a VM and it can be only reproduced on Windows 10 - after installing Windows 11 the issue disappeared.

CrendKing commented 2 months ago

I'm running Windows 11 (build 22631.3447), use Windows Terminal as default terminal, and I notice if I run a cmd file, it always opens in a new terminal window than say I run "wt.exe". However, if I create a shortcut with wt.exe test.cmd, that terminal window can be reused.

Like DHowett mentioned above, I think the default terminal handler has special logic to put those associated file opening in a separate terminal process, which has "-Embedding" in the launch command line and parented by svchost.exe.

Right now, I basically have to put "wt.exe" in front of every cmd file launch to reuse window, which defeats the whole purpose of setting Windows Terminal as default terminal.