terminal icon indicating copy to clipboard operation
terminal copied to clipboard

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

Open Mersid opened this issue 2 years ago • 15 comments


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.

Mersid avatar Jun 05 '23 08:06 Mersid

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

237dmitry avatar Jun 05 '23 13:06 237dmitry

My apologies, I do not understand?

Mersid avatar Jun 05 '23 18:06 Mersid

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

zadjii-msft avatar Jun 05 '23 19:06 zadjii-msft

No, I am not running Terminal as admin.

Mersid avatar Jun 05 '23 20:06 Mersid

I do not understand?

Read this

  • set Windows Terminal as default console
  • set "windowingBehavior": "useExisting" in settings.json

237dmitry avatar Jun 05 '23 23:06 237dmitry

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

Mersid avatar Jun 07 '23 20:06 Mersid

Hi @Mersid.

  • Does this repro if you switch default terminal over to the non-preview version? (make sure windowingBehavior is properly set and you're not running terminal as admin, as mentioned earlier in the thread) We're thinking this may be related to the process model changes we made to the preview version.

carlos-zamora avatar Jun 14 '23 21:06 carlos-zamora

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.

DHowett avatar Jun 14 '23 21:06 DHowett

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.

Mersid avatar Jun 14 '23 22:06 Mersid

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.

zadjii-msft avatar Aug 31 '23 16:08 zadjii-msft

@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).

krzysdz avatar Aug 31 '23 16:08 krzysdz

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.

DHowett avatar Aug 31 '23 23:08 DHowett

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.

bracco23 avatar Nov 05 '23 21:11 bracco23

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.

krzysdz avatar Nov 06 '23 20:11 krzysdz

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.

CrendKing avatar May 09 '24 08:05 CrendKing