-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Tab Button should open the active profile instead of default #11337
Comments
You know, I could have sworn we had a discussion thread already for "change the new tab button to duplicate the current pane rather than use the default profile" but I can't seem to find that discussion |
I've tried looking for it beforehand but didn't come across anything either. However I think I did see some that mention similar functionality when splitting an existing pane. |
You know, I might be wrong about that. I had this in my list of "issues to post in the future"
Crazy shower thought: "newTabButton": {
"action": { /* duplicate tab*/ },
"icon": "whatever",
"showDropdown": false
} Also related: #6685 |
Although I think it's out of scope for this Feature-Request. The above is a request for taskbar customization, while #11337 is about expanding the Either way I suppose there could be some demand for a splitPane button or taskbar customization. On the GUI side of things, currently the buttons next to the tab bar consist of a left and a right button: I suppose a good way to implement toolbar customization would be to have additional buttons shown in the middle. Maybe a config could allow for n buttons to be defined, where in "+" being the first button and any additional buttons are placed in between. |
Semi-related, if you really want buttons which open a new tab to a specific profile, here's a clean workaround: Create some shortcuts with targets similar to the following: |
I'd like to weigh in, here, and add that this feature (or feature group) would be pretty vital, for me. For example, one of my most common invocations of
To me, it makes absolutely no sense that subsequently, in the window that appears, both the split-pane commands and the default new-tab button open Similarly, if I start
... and I would expect that new-tabs and split-panes would also apply my At the very least, all of the above should be optional behaviour modes. Even if they do not match everybody's use-case, the above two cover pretty much 99% of my workflows with |
@stephenmartindale you may be interested in these might be reasonable workarounds while we work on this 😄 |
They are not. The existing "duplicate" behaviour does not create a duplicate. It respects the profile, but not command-line and starting directory. |
Ah, right, I forgot we haven't gotten around to #5047 (comment) yet. That'll help with your scenario |
Issue logged: #11678 |
I believe, but have not tested, that if |
I tinkered on this a bit out of curiosity and it turned out to be pretty easy to implement: https://github.com/PathogenDavid/windows-terminal/commit/67a370e5ab5168598fa48491f22c40b5d7ca36fe diff --git a/src/cascadia/TerminalApp/TerminalPage.cpp b/src/cascadia/TerminalApp/TerminalPage.cpp
index 752e8e590..96b80f16a 100644
--- a/src/cascadia/TerminalApp/TerminalPage.cpp
+++ b/src/cascadia/TerminalApp/TerminalPage.cpp
@@ -214,5 +214,13 @@ namespace winrt::TerminalApp::implementation
if (auto page{ weakThis.get() })
{
- page->_OpenNewTerminal(NewTerminalArgs());
+ // Duplicate the focused terminal if there is one, otherwise create one from the default profile
+ if (const auto focusedTab{ page->_GetFocusedTabImpl() })
+ {
+ page->_DuplicateTab(*focusedTab);
+ }
+ else
+ {
+ page->_OpenNewTerminal(NewTerminalArgs());
+ }
}
}); (Unfortunately I'm not very confident I'll have any time soon to formalize it enough to make it a proper contribution, but maybe I'll save someone else a bit of time investigating.) Edit: Worth noting that this doesn't handle the keyboard shortcuts, just clicking the button. Ctrl+Shift+T comes in in TerminalPage::_HandleNewTab and it already has |
Lawdy, look at that. Digging through the backlog, this looks like it is a /dup of #445. I'm gonna leave that one open since it has more 👍's. I've moved a bunch of relevant comments to that thread. Thanks all! |
Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report! |
Description of the new feature/enhancement
Currently the new tab button opens a terminal the default profile. So for example, with my default set to WSL: Debian, the new tab button will always open with that profile.
Instead I think it'd be nice to have the new tab button open a terminal using the same profile as the currently active tab. This way if I have a non-default profile open, such as PowerShell, the + button would open a new PowerShell tab instead.
Proposed technical implementation details
The default profile could have an additional setting called
Currently Active
. When a new tab is opened you'd need a way to retrieve the profile of the currently active tab, then open the new tab using that profile.The text was updated successfully, but these errors were encountered: