5

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 code.py 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?

Kevin Panko
  • 7,366

3 Answers3

12

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

TRS-80
  • 3,413
1

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 ?

1

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.

innaM
  • 10,302