[Qt-creator] 'Open Terminal Here' and login shell on Linux

Andrzej Telszewski atelszewski at gmail.com
Wed Dec 9 19:13:52 CET 2015


On 09/12/15 18:15, Uwe Rathmann wrote:
> On Wed, 09 Dec 2015 12:00:55 +0100, Andrzej Telszewski wrote:
>
>> 1. Why do you say .bashrc is better than .profile?
>
> There is no good or bad - it is simply, that there are rules, when which
> file is read. The basic idea is, that .profile is read once, when you
> login, while .bashrc is read, each time you open a bash ( it is similar
> for other shells ).
>
> When opening a terminal from the creator it is pretty clear, that you
> don't login ( you have been before starting the creator ) and all the
> settings from .profile should already be already available ( environment
> variables are inherited to child processes ).
>
> So to me it sound more, that you want to initialize your bash in this new
> terminal and this would be what .bashrc is made for.
>
> ciao,
> Uwe
>

OK, it seems there is something to what you say;)

I did the comparison of login and non-login shell environments and they 
are exactly the same.

The point is that, I have functions defined in /etc/profile.d/ and 
(un)fortunately those aren't inherited by the non-login shells.

My solution for now is to explicitly source selected files from 
/etc/profile.d in ~/.bashrc for non-login shells.

It's not the perfect solution, because there are functions I would like 
to be defined for all the users at all times.

Unfortunately there don't seem to be a global file that is sourced when 
non-login shell is started. This reminds me on why I always was starting 
login shells ;)

What I tested and does not work for me:
/etc/bashrc
/etc/bash_profile
/etc/bash.bashrc


Are there any chances that additional settings for Terminal in Qt 
Creator could be added?

-- 
Best regards,
Andrzej Telszewski



More information about the Qt-creator mailing list