terminal icon indicating copy to clipboard operation
terminal copied to clipboard

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

Open zadjii-msft opened this issue 5 years ago • 10 comments

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

zadjii-msft avatar Mar 20 '20 20:03 zadjii-msft

Yonking triage.

DHowett-MSFT avatar Mar 20 '20 22:03 DHowett-MSFT

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 avatar Aug 25 '20 14:08 zadjii-msft

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 avatar Aug 17 '21 23:08 DHowett

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

Handy links:

ghost avatar Aug 31 '21 17:08 ghost

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

zadjii-msft avatar Sep 27 '21 11:09 zadjii-msft

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 avatar Oct 05 '21 16:10 DHowett

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 avatar May 02 '22 11:05 zadjii-msft

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 avatar May 10 '23 21:05 zadjii-msft

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 avatar Jul 01 '24 15:07 plutonium-239

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

eight04 avatar Aug 15 '24 03:08 eight04