News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

launch console programs using gnome-terminal with environment set

Started by Napoleon, October 05, 2014, 09:59:00 AM

Previous topic - Next topic

Napoleon

In the 'Environment' general settings I have:
"Shell to run commands in" set to /bin/bash -i -c
"Terminal to launch console programs" set to gnome-terminal --geometry +1921+0 --disable-factory -x

Compiling my projects, some of which use of custom makefiles, works fine as per the 'Shell' setting above.

However, when I'm debugging my code, the terminal comes up and runs my program, but it doesn't have the environment set up  as per my ~/.bashrc.
The only way I've been able to get the environment variables set up thus far has been by editting /etc/profile.  Which is not really how I want to do it.

Could someone advise how to set the "Terminal" parameter such that it reads ~/.bashrc (or one of the others)?

Cheers,
Nap

oBFusCATed

When launching the debugger, C::B doens't launch any shell process so the debugger doesn't see the env vars defined in a shell.
The terminal is launched as a separate process and then gdb uses it as tty.
You can use your favourite process explorer (top, htop, ps) to see how things work.

Probably the most reliable way to set env vars is using the envvar plugin. Settings -> Environment -> Env Var.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Napoleon

@oBFusCATed,  ic.  Thanks.

I've got them in /etc/profile already and its working, so I'll stick with that on this project.