inheriting environmental variables when creating new terminal window or tab

Bug #1058515 reported by Vaclav Petras
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
gnome-terminal (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

If I create new terminal using gnome-terminal command (in terminal), it inherits environmental variables from the old terminal as any other application does. But if I create new terminal using Open Tab or Open Terminal, I get a fresh terminal. This is sometimes what I want but sometimes not.

I miss the possibility to copy environmental variables from the old terminal to the new one. Option in preferences would be ok. But some way to switch the behaviour quickly would be better.

For user there is no difference between the new window/tab and gnome-terminal command. Only the inheriting of environmental variables.

I also noticed that there is no option to preset environmental variables for the terminal. Some combination of Profiles and .bashrc file. However this is a different bug but probably connected, so that why I'm mentioning it.

Ubuntu 10.04, GNOME Terminal 2.30.2

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gnome-terminal (Ubuntu):
status: New → Confirmed
Revision history for this message
Anish Sane (anishsane) wrote :

>> If I create new terminal using Open Tab or Open Terminal, I get a fresh terminal. This is sometimes what I want but sometimes not.
We can possibly have an array holding names of such variables, which need to be 'exported' to the new tab.
Or, we can have a checkbox in gnome-terminal menus, if we want to inherit variables or not.
Or, we can have 2 separate menu items: "new tab", "new tabs with environment"

Currently, I am using a dirty trick of writing them to a file in /tmp via PROMPT_COMMAND & then reading it via .bashrc. But it is clearly inefficient & error prone.

Revision history for this message
Roy Stogner (roy-stogners) wrote :

I just tried switching from xfce4-terminal to gnome-terminal, only to discover that new tabs spawned via Ctrl+Shift+T (or File->New Tab) in the latter fail to inherit my session's $SSH_AUTH_SOCK or $SSH_AGENT_PID.

The second-best workaround is indeed to only spawn new tabs via "gnome-terminal --tab", but that's a bit unwieldy and it's not quite the same (the new tab inherits the environment of the shell running that command, which may have changed from the session environment), so I'm afraid the best workaround was to switch back to xfce4-terminal...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.