Commit 16bd9f6a authored by Christian Persch's avatar Christian Persch
Browse files

Revert "screen: Use clean env when creating new tab"

The patch is correct, but it exposes a deficiency in the desktop
environment in that the WM/shell's environment contains necessary
env vars (e.g. ssh-agent variables) that are missing from the
systemd --user / d-bus activation environment.  The desktop will
need to update the activation environment, but until that is done,
reverting the patch will revert gnome-terminal to the previous
behaviour of effectively using the environment of the client
of the first terminal created for all new terminals opened via
new terminal/tab/window.

This reverts commit 9bb94e3a.

#253
(cherry picked from commit 57ea15c4)
parent e7bfd768
......@@ -264,7 +264,8 @@ exec_data_new (void)
}
static ExecData *
exec_data_clone (ExecData *data)
exec_data_clone (ExecData *data,
gboolean preserve_argv)
{
if (data == NULL)
return NULL;
......@@ -274,7 +275,8 @@ exec_data_clone (ExecData *data)
clone->cwd = g_strdup (data->cwd);
/* If FDs were passed, cannot repeat argv. Return data only for env and cwd */
if (data->fd_list != NULL) {
if (!preserve_argv ||
data->fd_list != NULL) {
clone->as_shell = TRUE;
return clone;
}
......@@ -846,6 +848,7 @@ terminal_screen_reexec_from_screen (TerminalScreen *screen,
g_return_val_if_fail (TERMINAL_IS_SCREEN (parent_screen), FALSE);
terminal_unref_exec_data ExecData* data = exec_data_clone (parent_screen->priv->exec_data, FALSE);
gs_free char* cwd = terminal_screen_get_current_dir (parent_screen);
_terminal_debug_print (TERMINAL_DEBUG_PROCESSES,
......@@ -855,7 +858,7 @@ terminal_screen_reexec_from_screen (TerminalScreen *screen,
cwd);
return terminal_screen_reexec_from_exec_data (screen,
NULL /* exec data */,
data,
NULL /* envv */,
cwd,
cancellable,
......@@ -1578,7 +1581,7 @@ spawn_result_cb (VteTerminal *terminal,
}
/* Retain info for reexec, if possible */
ExecData *new_exec_data = exec_data_clone (exec_data);
ExecData *new_exec_data = exec_data_clone (exec_data, TRUE);
terminal_screen_clear_exec_data (screen, FALSE);
priv->exec_data = new_exec_data;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment