Duplicating a tab/pane without a valid profile should still duplicate the settings from that tab #7045

Open
opened 2026-01-31 00:53:42 +00:00 by claunia · 10 comments
Owner

Originally created by @zadjii-msft on GitHub (Mar 20, 2020).

This is a follow-up from PR #4429, and bug #2455

I actually don't hate the idea of just duplicating the settings for the existing control. In that scenario, we'd probably just ignore the settings for that profile in the actual file, and just use whatever settings the control currently has. This might require some plumbing, but it's doable.

Okay this is harder, but maybe not impossible, but probably impossible in v1.
The Profile knows how to build the connection settings, and the ControlSettings, etc. However, when the settings reloads like in this bug, we'll remove all the old profiles, and build a new list.
If we wanted the case 1 behavior, we could wait until the Profile is a winrt object, then have each Pane hold a strong ref to the Profile that it's hosting. Then it would be trivial to be able to duplicate the settings from it. I believe that work is tracked in #3998.

As of #4429, we'll silently do nothing. We should instead get the Profile from the Pane/Tab that we're duplicating, and use that to build the settings instead.


note to self: this is the "duplicate the NewTerminalArgs, not just the Profile" thread

Originally created by @zadjii-msft on GitHub (Mar 20, 2020). This is a follow-up from PR #4429, and bug #2455 > I actually don't hate the idea of just duplicating the settings for the existing control. In that scenario, we'd probably just ignore the settings for that profile in the actual file, and just use whatever settings the control currently has. This might require some plumbing, but it's doable. > Okay this is harder, but maybe not impossible, but probably impossible in v1. > The `Profile` knows how to build the connection settings, and the `ControlSettings`, etc. However, when the settings reloads like in this bug, we'll remove all the old profiles, and build a new list. > If we wanted the case 1 behavior, we could wait until the `Profile` is a winrt object, then have each Pane hold a strong ref to the `Profile` that it's hosting. Then it would be trivial to be able to duplicate the settings from it. I believe that work is tracked in #3998. As of #4429, we'll silently do nothing. We should instead get the `Profile` from the `Pane`/`Tab` that we're duplicating, and use that to build the settings instead. ------------- note to self: this is the "duplicate the `NewTerminalArgs`, not just the Profile" thread
claunia added the Issue-TaskPriority-3Product-TerminalArea-UserInterface labels 2026-01-31 00:53:42 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (Mar 20, 2020):

Yonking triage.

@DHowett-MSFT commented on GitHub (Mar 20, 2020): Yonking triage.
Author
Owner

@zadjii-msft commented on GitHub (Aug 25, 2020):

Oh hey, this would be related to #6689. If we can get the current settings from the control, to be able to make a change and "preview" them, then we'll be able to get the settings to be able to duplicate the tab/pane w/o the profile

@zadjii-msft commented on GitHub (Aug 25, 2020): Oh hey, this would be related to #6689. If we can get the current settings from the control, to be able to make a change and "preview" them, then we'll be able to get the settings to be able to duplicate the tab/pane w/o the profile
Author
Owner

@DHowett commented on GitHub (Aug 18, 2021):

I'm taking this, as I ended up replacing the use and storage of GUIDs with Profile object references. You can now duplicate a tab of a deleted profile (!)

@DHowett commented on GitHub (Aug 18, 2021): I'm taking this, as I ended up replacing the use and storage of GUIDs with Profile object references. You can now duplicate a tab of a deleted profile (!)
Author
Owner

@ghost commented on GitHub (Aug 31, 2021):

:tada:This issue was addressed in #10982, which has now been successfully released as Windows Terminal Preview v1.11.2421.0.🎉

Handy links:

@ghost commented on GitHub (Aug 31, 2021): :tada:This issue was addressed in #10982, which has now been successfully released as `Windows Terminal Preview v1.11.2421.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.11.2421.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Author
Owner

@zadjii-msft commented on GitHub (Sep 27, 2021):

@DHowett why'd we reopen this? I thought we did this in #10982?

@zadjii-msft commented on GitHub (Sep 27, 2021): @DHowett why'd we reopen this? I thought we did this in #10982?
Author
Owner

@DHowett commented on GitHub (Oct 5, 2021):

Sorta. Right now we duplicate the profile, but what we really should do is duplicate the NewTerminalArgs (or equivalent, a version we have re-created from the active settings thanks to Rosefield's persistence work) that spawned the pane. That way, we also duplicate any other live settings and the commandline used to spawn the application (if it wasn't the one that came from the profile)

@DHowett commented on GitHub (Oct 5, 2021): Sorta. Right now we duplicate the *profile*, but what we really should do is duplicate the NewTerminalArgs (or equivalent, a version we have re-created from the active settings thanks to Rosefield's persistence work) that spawned the pane. That way, we also duplicate any other live settings and the commandline used to spawn the application (if it wasn't the one that came from the profile)
Author
Owner

@zadjii-msft commented on GitHub (May 2, 2022):

From @cpriest in #12760:

Adding on to this ticket because my issue is similar.

If I launch windows terminal with custom arguments such as wt.exe ssh ..., then duplicate tab, split pane, none of them work. This is in the same vein as above in that it should exec the same ssh.exe ... in the new tab / pane.

Right now, a new tab opens and then dies immediately.

@zadjii-msft commented on GitHub (May 2, 2022): _From @cpriest in #12760:_ > Adding on to this ticket because my issue is similar. > > If I launch windows terminal with custom arguments such as `wt.exe ssh ...`, then duplicate tab, split pane, none of them work. This is in the same vein as above in that it should exec the same `ssh.exe ...` in the new tab / pane. > > Right now, a new tab opens and then dies immediately.
Author
Owner

@zadjii-msft commented on GitHub (May 10, 2023):

Steps to reproduce

Not entirely sure which actions are relevant, and i have a hard time reproducing with explicit actions, so i'll outline my flow

  • Plug laptop into dock
  • Start windows terminal (pwsh profile). (suppressApplicationTitle is set to "true" in the settings.json file)
  • Launch new tab(s) in a new window, specifying titles for tabs

wt.exe -w 2 --title 6000 -p cmd cmd /c "cd \"c:\projectdirectory\" &\"C:\Program Files\dotnet\dotnet.exe\" run --urls \"http://*:6000\" &pause"

  • Some time later, unplug laptop from dock and close
  • Take laptop elsewhere (some amount of commute time), and plug into new dock.
  • Most likely, wait until the following day before opening the laptop again

Expected Behavior

Tab titles should be retained

Actual Behavior

Tab titles revert to the command. In the example, tab title changes to "cmd"

@zadjii-msft commented on GitHub (May 10, 2023): > ### Steps to reproduce > > Not entirely sure which actions are relevant, and i have a hard time reproducing with explicit actions, so i'll outline my flow > > - Plug laptop into dock > - Start windows terminal (pwsh profile). (suppressApplicationTitle is set to "true" in the settings.json file) > - Launch new tab(s) in a new window, specifying titles for tabs > > `wt.exe -w 2 --title 6000 -p cmd cmd /c "cd \"c:\projectdirectory\" &\"C:\Program Files\dotnet\dotnet.exe\" run --urls \"http://*:6000\" &pause"` > > - Some time later, unplug laptop from dock and close > - Take laptop elsewhere (some amount of commute time), and plug into new dock. > - Most likely, wait until the following day before opening the laptop again > > ### Expected Behavior > > Tab titles should be retained > > ### Actual Behavior > > Tab titles revert to the command. In the example, tab title changes to "cmd"
Author
Owner

@plutonium-239 commented on GitHub (Jul 1, 2024):

Coming from #17337
Hello, acc to this comment, this feature was introduced in v1.11 Preview, but the release notes don't mention duplicating the tab while keeping the same directory (and is also not in v1.20 stable).

I'm sorry for not understanding, but is that not what was planned/how it is supposed to work?

@plutonium-239 commented on GitHub (Jul 1, 2024): Coming from #17337 Hello, acc to [this comment](https://github.com/microsoft/terminal/issues/5047#issuecomment-909423698), this feature was introduced in v1.11 Preview, but the release notes don't mention duplicating the tab while keeping the same directory (and is also not in v1.20 stable). I'm sorry for not understanding, but is that not what was planned/how it is supposed to work?
Author
Owner

@eight04 commented on GitHub (Aug 15, 2024):

@plutonium-239 Here is the tutorial: https://github.com/microsoft/terminal/issues/13195#issuecomment-1165017828

@eight04 commented on GitHub (Aug 15, 2024): @plutonium-239 Here is the tutorial: https://github.com/microsoft/terminal/issues/13195#issuecomment-1165017828
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#7045