Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Say I am using terminal and have sshed to a remote machine and did something.
How do I create a new terminal tab (or window) so I still has everything from the previous terminal window without having to do the whole thing like ssh, cd, etc. – just like forking. Then I can start working in the new window separately from the previous one.

share|improve this question
    
Is an X11 window sufficient? –  Nils Jan 14 '12 at 20:14

4 Answers 4

up vote 4 down vote accepted

Not exactly what you ask, because you don't have a new real window or tab.

You can start screen on the server (if available), so that you can multiplex your server sessions.

After that you have still a single screen window, but if you do Ctrl+a c, you create a new screen window, and switch between the windows with Ctrl+a 0, Ctrl+a 1.

You have the added advantage that you can disconnect from the server leaving the two (or more) sessions alive (Ctrl+a d), then restore them later (screen -dr).

share|improve this answer

Not possible. gnome-terminals however could preserve the current working directory if invoked from the terminal's right-click menu. But asking it to ssh would be difficult perhaps thing to do in a straight away fashion. However, there is this gnome specific panel applet (I guess written in ruby) that can help you manage your ssh connections in a menu based interaction. http://sshmenu.sourceforge.net/

share|improve this answer

The simplest solution: use screen or tmux.

share|improve this answer

One of the things I like to do here is ssh X redirection. You do NOT need X installed on the remote machine to do this.

I use a small wrapper script called xon, but you could use a simple ssh -Y -f hostname.tld xterm

Now at some point I want to open a new terminal, I can just type xterm again, and I will have a new xterm from the remote server.

Server requirements: xterm, xauth

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.