Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let's assume that you are at /users/cs/uni/databases/python/codes/ and you want to compare the outputs of the same command with different parameters.

The program asks you the outputs such that you would like to have two windows open at the same folder such that you can run simply python at both windows for different parameters.

I would like to know how you open a new tab in Screen such that the location of the new tab is at the folder where you are at. If I open a new tab, the location of the tab is at my Home.

How can you make a new tab open at the current folder in Screen?

share|improve this question
up vote 11 down vote accepted

Just run screen inside screen and it'll open a new window in the current directory.

share|improve this answer
Ouch!! Who would have thought it could be THAT easy? – innaM Jul 24 '09 at 12:52
Very cool! What if we're running some long process and can't get to a prompt, though? – ojrac Feb 24 '10 at 6:03
@orjac: Perhaps ^z, screen, fg ? – TRS-80 Feb 28 '10 at 17:22
Thank you for the answer! - It was easier than I first thought. – Masi Sep 28 '11 at 21:44

I usually do a screen -dmS SessionName && screen -r SessionName and I'm in my working dir not my Home dir.

Maybe you have some custom config file ?

share|improve this answer

How about this:

screen -X chdir `pwd`; screen -X screen

This sets screen's (not your shell's) current directory to your shell's current directory and opens a new window.

You could also do

screen -X chdir `pwd`; screen -X screen; screen -X ~

This will additionally restore screen's current directory to your home directory.

Put that in an alias and you should be fine.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .