Support cwd and environment