User forums > General (but related to Code::Blocks)

launch console programs using gnome-terminal with environment set

(1/1)

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

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.

Napoleon:
@oBFusCATed,  ic.  Thanks.

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

Navigation

[0] Message Index

Go to full version