Veja uma cópia de minha própria resposta para uma pergunta semelhante em stackoverflow.com :
To make screen open a new tab/window in the current directory, you can
add the following code to your .screenrc
file:
bind c stuff "screen bash^M"
This will cause the Ctrl + a c
command to open new tabs/windows in the directory of the current
window/tab.
Note: You must ensure that screen
does not start a login shell by
default because that will cause the shell start in the default
directory for a login shell rather than the current directory. This
means that In your .screenrc
file, your shell
command cannot
include a dash ('-') character.
For example, this is wrong (i.e. it will start a login shell):
shell -$SHELL
But this is right (i.e. it will not start a login shell):
shell $SHELL
Note 2: Unfortunately, this method does not behave exactly like the default new window/tab command in screen
. Instead, it writes the
command to the current window and executes it to create the new
window/tab, so it will not work during some long running shell
process. In other words, this keyboard shortcut can only be executed
whenever normal shell commands can be executed.
Note 3: If you want screen
to open new windows/tabs in the current directory and open a login shell, you can add the
following code to your .screenrc
file:
bind c stuff "screen bash -l^M"