Clone tab/window

886 views
Skip to first unread message

Mike Machado

unread,
Aug 2, 2011, 12:35:58 AM8/2/11
to iterm2-discuss
I find it VERY common to want to be able to clone a window or tab -
not just open a new window/tab, but to open a new tab cloned from the
current profile. Use case is working on something on a server and
needing an additional tab to complete my work. Doing a horizontal/
vertical split is the closest thing there is, but I don't necessarily
want a spit window - i want a full new tab and I don't want to have to
reselect which profile I am connected to (as with creating a new tab/
window option would do).

Is this something that can be done today or a new feature others would
find useful?

George Nachman

unread,
Aug 2, 2011, 1:46:51 AM8/2/11
to iterm2-...@googlegroups.com
It can't be done today. I'm interested if others would find it useful, though.

Vince LaMonica

unread,
Aug 2, 2011, 2:33:03 AM8/2/11
to iterm2-...@googlegroups.com
I would find it useful, but perhaps an easier way to implement it would be to assign shortcut keys to different profiles. There are times I want a new tab [and sometimes a new window] with the same server I am logged into; perhaps it is 3rd on my profile list. I have to put my hands on the mouse and select it, rather than use a shortcut key to open a new tab [or w/ option key, new window].

Perhaps that feature exists already, but there are no shortcut keys shown in the Profiles menu [using 1.0.0.20110727 because I have some processes running that can't be restarted for a bit; i'll update to 731 in the morning :) ].

TIA!

/vjl/

Chris Abnett

unread,
Aug 2, 2011, 8:20:58 AM8/2/11
to iterm2-...@googlegroups.com
Isnt this the same as going to profiles and selecting the profile? It for
me always opens a new tab with the profile of my choice... So I can
effectively open duplicate sessions of the same server.. (which I do)...
-Christopher

Breckin Loggins

unread,
Aug 2, 2011, 9:27:12 AM8/2/11
to iterm2-...@googlegroups.com
I'd just like to be able to do a Cmd+Shift+T and open a tab in the same PWD as the last tab I was in :)

George Nachman

unread,
Aug 2, 2011, 1:51:25 PM8/2/11
to iterm2-...@googlegroups.com
You can configure a profile to reuse the current PWD. Is this something that you only want to do sometimes?

Breckin Loggins

unread,
Aug 2, 2011, 1:53:52 PM8/2/11
to iterm2-...@googlegroups.com
My workflow (which is probably too specific to justify a feature):

1. Open iTerm, cd to ~/foo, vim
2. Open new Tab, cd to ~/foo
3. Switch back and forth between vim and the command shell (almost always do this in pairs like this, with two tabs per "project")

For some reason I prefer this over doing in-tab splitting.  Don't know why.

- Breckin

George Nachman

unread,
Aug 2, 2011, 2:06:33 PM8/2/11
to iterm2-...@googlegroups.com
That sounds like it would be compatible with configuring your profile to reuse the current directory. Does that solve your problem?

Breckin Loggins

unread,
Aug 2, 2011, 2:07:22 PM8/2/11
to iterm2-...@googlegroups.com
Probably so :)

Mike Machado

unread,
Aug 2, 2011, 6:12:01 PM8/2/11
to iterm2-discuss
This is exactly the workflow I am doing. I didn't even think of PWD
setting. That would be even more awesome!

Can we have this feature? Pretty please?! :)

Renault

unread,
Aug 4, 2011, 1:30:39 PM8/4/11
to iterm2-discuss
I was constantly needing this, until I've started to use tmux, an
outstanding terminal multiplexer. When I'm remotely connected to my
dev machine, I just start tmux which let me split the window or create
as many tabs as I need, directly on my remote machine.

http://tmux.sourceforge.net/

Apparently, there is an initiative to integrate tmux with iTerm2.
http://code.google.com/p/iterm2/wiki/TmuxIntegration

Renault

spork

unread,
Aug 5, 2011, 1:20:47 AM8/5/11
to iterm2-discuss
On Aug 4, 1:30 pm, Renault <renault.j...@gmail.com> wrote:
> I was constantly needing this, until I've started to use tmux, an
> outstanding terminal multiplexer. When I'm remotely connected to my
> dev machine, I just start tmux which let me split the window or create
> as many tabs as I need, directly on my remote machine.
>
> http://tmux.sourceforge.net/

I know this is quite a bit OT for this group, but I've been meaning to
start using screen and then tmux for the last 10 years or so. Never
quite got around to it. I have many reasons why I should be using it,
such as:

-Being in the middle of something and needing to hop from desktop to
laptop or vice-versa
-Putting of iterm or OS updates because I don't want to lose my 30
open iTerm windows
-Travel
-Making good use of jumphosts when on networks that aren't whitelisted
-Easier connections from a phone

I am sure there are many more plusses, but those are the practical
things that keep me thinking about going with tmux.

On the downside, these are the things that have always bugged me about
screen or tmux:

-Security - not sure I trust running sessions, many likely in as root
or in via a console server to sensitive things, all being available
via a socket in /tmp. Part of this is due to the fact that I've never
really studied just how tmux protects your sessions of course.
-Scrollback - this always made me run screaming from the term muxers.
Not sure I can deal with only scrolling via keys. I've gotten very
used to my scroll nub.
-Memorizing yet another set of keyboard shortcuts. My brain may be
full.
-Until I've learned a good workflow, it seems like dealing with 30-50
sessions might be a bit hard compared to just popping a new window via
a bookmark.

Anyone want to convince me? Any good "jump in and start doing stuff"
sort of guides for tmux to share?

> Apparently, there is an initiative to integrate tmux with iTerm2.http://code.google.com/p/iterm2/wiki/TmuxIntegration

Even though I don't yet use tmux, this just strikes me as an excellent
idea.

C
Reply all
Reply to author
Forward
0 new messages