Feature Request - Duplicate tab (Basic) #2097

Closed
opened 2026-01-30 22:46:41 +00:00 by claunia · 21 comments
Owner

Originally created by @J00MZ on GitHub (Jun 24, 2019).

Summary

Add "Duplicate Tab" option to open same profile in different tab

Originally created by @J00MZ on GitHub (Jun 24, 2019). # Summary Add "Duplicate Tab" option to open same profile in different tab
Author
Owner

@dnagl commented on GitHub (Jun 25, 2019):

How sould you be able to trigger the duplication of a tab?

@dnagl commented on GitHub (Jun 25, 2019): How sould you be able to trigger the duplication of a tab?
Author
Owner

@carlos-zamora commented on GitHub (Jun 25, 2019):

So, what do you mean by "duplicate"? I have a few ways to interpret this:

  • "Simple": same thing as opening a new tab of the same profile via the drop down menu
  • "Partial State Copy": new tab has the same profile but is in the same directory (if applicable). This is similar to #1437
  • "Full State Copy": keep the command history intact and be in the same directory

Also, if there's interest in the latter two, what are some things in the "state" that should be maintained?

NOTE: I think we wouldn't be able to do the last one today, but we can definitely make strides towards it in the long run :)

@carlos-zamora commented on GitHub (Jun 25, 2019): So, what do you mean by "duplicate"? I have a few ways to interpret this: - **"Simple"**: same thing as opening a new tab of the same profile via the drop down menu - **"Partial State Copy"**: new tab has the same profile but is in the same directory (if applicable). This is similar to #1437 - **"Full State Copy"**: keep the command history intact and be in the same directory Also, if there's interest in the latter two, what are some things in the "state" that should be maintained? NOTE: I think we wouldn't be able to do the last one today, but we can definitely make strides towards it in the long run :)
Author
Owner

@J00MZ commented on GitHub (Jun 25, 2019):

@dnagl, triggering could be using Keyboard combo such as Ctrl+Shift+D
@carlos-zamora , excellent breakdown, I was thinking "Simple", duplicating the current profile only.

However, I see no reason 2, 3 can't be in the long run Roadmap too as you noted.

Re "state":
My use case is SSHing from local shell to multiple remote servers, so duplicating the SSH session from current profile would be very useful.

@J00MZ commented on GitHub (Jun 25, 2019): @dnagl, triggering could be using Keyboard combo such as Ctrl+Shift+D @carlos-zamora , excellent breakdown, I was thinking "**Simple**", duplicating the current profile only. However, I see no reason 2, 3 can't be in the long run Roadmap too as you noted. Re "state": My use case is SSHing from local shell to multiple remote servers, so duplicating the SSH session from current profile would be very useful.
Author
Owner

@carlos-zamora commented on GitHub (Jun 25, 2019):

Personally, I think this would be a great thing to have as an option in a flyout menu when you right-click on a tab. Similar to when you right-click a tab in Edge.

@carlos-zamora commented on GitHub (Jun 25, 2019): Personally, I think this would be a great thing to have as an option in a flyout menu when you right-click on a tab. Similar to when you right-click a tab in Edge.
Author
Owner

@dnagl commented on GitHub (Jun 25, 2019):

@J00MZ I am with you that this is a bigger feature and to provide a simple implmentation to duplicate a tab with the current used profile would be the first step in the right direction.

@carlos-zamora A flyout menu would be a good idea. However, this functionality should be available also by using a keyboard shorcut.

Maybe I am able to provide a simple implementation of this feature request and bring it into the master of the project with a pull request.

@dnagl commented on GitHub (Jun 25, 2019): @J00MZ I am with you that this is a bigger feature and to provide a simple implmentation to duplicate a tab with the current used profile would be the first step in the right direction. @carlos-zamora A flyout menu would be a good idea. However, this functionality should be available also by using a keyboard shorcut. Maybe I am able to provide a simple implementation of this feature request and bring it into the master of the project with a pull request.
Author
Owner

@carlos-zamora commented on GitHub (Jun 25, 2019):

@dnagl Yup! We're on the same page. And we can't do the flyout menu until #760 gets resolved anyways.

I'd very much appreciate it if you implement this. 😊 Let me know if you have any questions! (and definitely add me as a reviewer so I get a notification when it comes in)

@carlos-zamora commented on GitHub (Jun 25, 2019): @dnagl Yup! We're on the same page. And we can't do the flyout menu until #760 gets resolved anyways. I'd very much appreciate it if you implement this. 😊 Let me know if you have any questions! (and definitely add me as a reviewer so I get a notification when it comes in)
Author
Owner

@xmm1989218 commented on GitHub (Jun 25, 2019):

@carlos-zamora "Simple" + custom shortcut is good enough
@J00MZ if has the "Simple" way, can use commandline in profile.json to implement FAKE "Full State Copy",

"commandline" : "wsl.exe -d Legacy -- /path_to/ssh_script",

@xmm1989218 commented on GitHub (Jun 25, 2019): @carlos-zamora "Simple" + custom shortcut is good enough @J00MZ if has the "Simple" way, can use commandline in profile.json to implement FAKE "Full State Copy", "commandline" : "wsl.exe -d Legacy -- /path_to/ssh_script",
Author
Owner

@J00MZ commented on GitHub (Jun 25, 2019):

@xmm1989218 I've used the command line in profile.json for similar stuff, such as defaulting to a specific directory which has my custom .bashrc, but I'd classify it as a "hack", not feature.

@J00MZ commented on GitHub (Jun 25, 2019): @xmm1989218 I've used the command line in profile.json for similar stuff, such as defaulting to a specific directory which has my custom .bashrc, but I'd classify it as a "hack", not feature.
Author
Owner

@xmm1989218 commented on GitHub (Jun 25, 2019):

@J00MZ your right. it is hack. if has many ssh-host will seem ugly. it just works at light startup job

@xmm1989218 commented on GitHub (Jun 25, 2019): @J00MZ your right. it is hack. if has many ssh-host will seem ugly. it just works at light startup job
Author
Owner

@dnagl commented on GitHub (Jun 26, 2019):

@carlos-zamora I have some problems to get the keybindings to work properly. Maybe you could have a look at the code in my repository and the last commit on the featurebranch. When I am pressing CTRL+SHIFT+D the method AppKeyBindings::TryKeyChord gets called but there is no element in _keyShortcuts for the keybinding

Repository

Edit

I fixed the problem. I was adding the keybinding in the wrong profiles.json file

@dnagl commented on GitHub (Jun 26, 2019): @carlos-zamora I have some problems to get the keybindings to work properly. Maybe you could have a look at the code in my repository and the last commit on the featurebranch. When I am pressing CTRL+SHIFT+D the method `AppKeyBindings::TryKeyChord` gets called but there is no element in `_keyShortcuts` for the keybinding [Repository](https://github.com/dnagl/terminal/tree/1536-duplicate-tab) ### Edit > I fixed the problem. I was adding the keybinding in the wrong `profiles.json` file
Author
Owner

@mdtauk commented on GitHub (Jun 26, 2019):

Would a duplicate Tab maintain the same history and current output?

@mdtauk commented on GitHub (Jun 26, 2019): Would a duplicate Tab maintain the same history and current output?
Author
Owner

@J00MZ commented on GitHub (Jun 26, 2019):

@mdtauk see @carlos-zamora reply re the options this could be implemented.

@J00MZ commented on GitHub (Jun 26, 2019): @mdtauk see @carlos-zamora reply re the options this could be implemented.
Author
Owner

@dnagl commented on GitHub (Jun 27, 2019):

@carlos-zamora I cannot add you as a reviewer to the pull request. Am I missing some permissions for this action?

@dnagl commented on GitHub (Jun 27, 2019): @carlos-zamora I cannot add you as a reviewer to the pull request. Am I missing some permissions for this action?
Author
Owner

@carlos-zamora commented on GitHub (Jun 27, 2019):

Huh. I guess you do need permissions for that. Found it though. I'll try and get to it tomorrow. Thanks!

@carlos-zamora commented on GitHub (Jun 27, 2019): Huh. I guess you do need permissions for that. Found it though. I'll try and get to it tomorrow. Thanks!
Author
Owner

@ghost commented on GitHub (Aug 3, 2019):

:tada:This issue was addressed in #1685, which has now been successfully released as Windows Terminal Preview v0.3.2142.0.🎉

Handy links:

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

@CoskunSunali commented on GitHub (Aug 7, 2019):

It seems that new tab and duplicate tab features work the same way for me when I use it for WSL. E.g. they both create a new tab and nothing else.

I SSHed into a server using Ubuntu, duplicated the tab, SSH session is not carried over. I switched to a directory and duplicated the tab, the directory was set to the default startingDirectory which is //wsl$/Ubuntu/home/coskun.

So why would I use the duplicate feature? No pun intended, just trying to understand what is the advantage of using the duplicate feature over creating a new tab.

@CoskunSunali commented on GitHub (Aug 7, 2019): It seems that new tab and duplicate tab features work the same way for me when I use it for WSL. E.g. they both create a new tab and nothing else. I SSHed into a server using Ubuntu, duplicated the tab, SSH session is not carried over. I switched to a directory and duplicated the tab, the directory was set to the default `startingDirectory` which is `//wsl$/Ubuntu/home/coskun`. So why would I use the duplicate feature? No pun intended, just trying to understand what is the advantage of using the duplicate feature over creating a new tab.
Author
Owner

@J00MZ commented on GitHub (Aug 7, 2019):

@CoskunSunali
The duplicate tab feature defaults to the profile you are using now.
Opening a new tab defaults to your default profile.

If you use various different profiles in Terminal, it's very convenient to duplicate your current working one rather than the default one.

For example, my default profile is Ubuntu 18 WSL, but I may want to duplicate my Powershell or Ubuntu 16 WSL tabs.

image

@J00MZ commented on GitHub (Aug 7, 2019): @CoskunSunali The duplicate tab feature defaults to the profile you are using now. Opening a new tab defaults to your default profile. If you use various different profiles in Terminal, it's very convenient to duplicate your current working one rather than the default one. For example, my default profile is Ubuntu 18 WSL, but I may want to duplicate my Powershell or Ubuntu 16 WSL tabs. ![image](https://user-images.githubusercontent.com/3058176/62620773-d2501100-b922-11e9-8646-443eb73b7511.png)
Author
Owner

@CoskunSunali commented on GitHub (Aug 7, 2019):

@J00MZ That totally makes sense. Thank you for the insights.

@CoskunSunali commented on GitHub (Aug 7, 2019): @J00MZ That totally makes sense. Thank you for the insights.
Author
Owner

@CoskunSunali commented on GitHub (Aug 7, 2019):

Sorry for the spam. Are there any plans for implementing state duplication? E.g. carrying over the SSH session?

@CoskunSunali commented on GitHub (Aug 7, 2019): Sorry for the spam. Are there any plans for implementing state duplication? E.g. carrying over the SSH session?
Author
Owner

@zadjii-msft commented on GitHub (Aug 7, 2019):

@CoskunSunali No, because that would likely be neigh impossible to do in a general sense. How would we duplicate an instance of vim for example? What if the foreground process has opened some sort of file for exclusive access - how could we duplicate that process?

If there's a way this can be done safely and generally I'm all ears for proposed technical solutions, but I don't think it's something that's possible, so I'm not going to be investigating it.

@zadjii-msft commented on GitHub (Aug 7, 2019): @CoskunSunali No, because that would likely be neigh impossible to do in a general sense. How would we duplicate an instance of vim for example? What if the foreground process has opened some sort of file for exclusive access - how could we duplicate that process? If there's a way this can be done safely and generally I'm all ears for proposed technical solutions, but I don't think it's something that's possible, so I'm not going to be investigating it.
Author
Owner

@CoskunSunali commented on GitHub (Aug 7, 2019):

@zadjii-msft and @J00MZ Thanks a lot for your time replying and explaining. Appreciated.

@CoskunSunali commented on GitHub (Aug 7, 2019): @zadjii-msft and @J00MZ Thanks a lot for your time replying and explaining. Appreciated.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#2097