terminal
terminal copied to clipboard
Duplicating a tab/pane without a valid profile should still duplicate the settings from that tab
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
Profileknows how to build the connection settings, and theControlSettings, 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 theProfileis a winrt object, then have each Pane hold a strong ref to theProfilethat 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
Yonking triage.
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
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 (!)
:tada:This issue was addressed in #10982, which has now been successfully released as Windows Terminal Preview v1.11.2421.0.:tada:
Handy links:
@DHowett why'd we reopen this? I thought we did this in #10982?
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)
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 samessh.exe ...in the new tab / pane.Right now, a new tab opens and then dies immediately.
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"
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 Here is the tutorial: https://github.com/microsoft/terminal/issues/13195#issuecomment-1165017828