Before launching a new terminal window change the current working directory

to that of the active tab. This makes the new terminal inherit it. Implements
the missing part of #6712.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39458 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2010-11-16 20:51:33 +00:00
parent 37322c4b52
commit 47589f1c26

View File

@ -477,6 +477,15 @@ TermWindow::MessageReceived(BMessage *message)
case MENU_NEW_TERM:
{
// Set our current working directory to that of the active tab, so
// that the new terminal and its shell inherit it.
// Note: That's a bit lame. We should rather fork() and change the
// CWD in the child, but since ATM there aren't any side effects of
// changing our CWD, we save ourselves the trouble.
ActiveProcessInfo activeProcessInfo;
if (_ActiveTermView()->GetActiveProcessInfo(activeProcessInfo))
chdir(activeProcessInfo.CurrentDirectory());
app_info info;
be_app->GetAppInfo(&info);