Commit 3e57ba80 authored by Christian Persch's avatar Christian Persch

client: Set the PWD correctly in the environment

Commit 760fbbd9 added the code at the wrong place,
move it to the right one.
parent fbbaf76f
......@@ -105,6 +105,7 @@ terminal_client_append_exec_options (GVariantBuilder *builder,
envv = g_environ_unsetenv (envv, "DESKTOP_STARTUP_ID");
envv = g_environ_unsetenv (envv, "GIO_LAUNCHED_DESKTOP_FILE_PID");
envv = g_environ_unsetenv (envv, "GIO_LAUNCHED_DESKTOP_FILE");
envv = g_environ_unsetenv (envv, "PWD");
g_variant_builder_add (builder, "{sv}",
"environ",
......
......@@ -1329,6 +1329,12 @@ get_child_environment (TerminalScreen *screen,
}
#endif
/* We need to put the working directory also in PWD, so that
* e.g. bash starts in the right directory if @cwd is a symlink.
* See bug #502146.
*/
g_hash_table_replace (env_table, g_strdup ("PWD"), g_strdup (cwd));
terminal_util_add_proxy_env (env_table);
retval = g_ptr_array_sized_new (g_hash_table_size (env_table));
......@@ -1339,12 +1345,6 @@ get_child_environment (TerminalScreen *screen,
*shell = g_strdup (g_hash_table_lookup (env_table, "SHELL"));
/* We need to put the working directory also in PWD, so that
* e.g. bash starts in the right directory if @cwd is a symlink.
* See bug #502146.
*/
g_hash_table_replace (env_table, g_strdup ("PWD"), g_strdup (cwd));
g_hash_table_destroy (env_table);
return (char **) g_ptr_array_free (retval, FALSE);
}
......
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