Bug 250507 - New Tab does not read ~/.bash_profile
Summary: New Tab does not read ~/.bash_profile
Status: RESOLVED WORKSFORME
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 2.5
Platform: Slackware Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-08 01:52 UTC by Andrzej
Modified: 2011-09-09 04:54 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
konsole - opened with icon (21.90 KB, image/png)
2011-09-07 20:11 UTC, Andrzej
Details
konsole - new tab opened with one click (23.28 KB, image/png)
2011-09-07 20:12 UTC, Andrzej
Details
konsole - new tab opened with menu-1 (36.52 KB, image/png)
2011-09-07 20:13 UTC, Andrzej
Details
konsole - new tab opened with menu-2 (22.98 KB, image/png)
2011-09-07 20:14 UTC, Andrzej
Details
konsole - new tab opened with button pressed=>default profile selected-1 (26.28 KB, image/png)
2011-09-07 20:16 UTC, Andrzej
Details
konsole - new tab opened with button pressed=>default profile selected-2 (23.43 KB, image/png)
2011-09-07 20:16 UTC, Andrzej
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrzej 2010-09-08 01:52:11 UTC
Version:           2.5 (using KDE 4.5.0) 
OS:                Linux

When I click File -> New Tab then I have to select a profile but terminal in new tab does not read ~/.bash_profile
The same happens when I select a profile after pressing "New Tab" button in tab bar.

Only pressing once "New Tab" button in tab bar gives expected result: ~/.bash_profile is read.

Reproducible: Always




OS: Linux (i686) release 2.6.35.4
Compiler: gcc
Comment 1 Jekyll Wu 2011-07-27 12:41:24 UTC
That is because ~/.bash_profile is for login bash only, and you did not tell konsole you want a login bash. 

To read ~/.bash_profile, you need to edit the profile and change the command to
'bash -l'.
Comment 2 Jekyll Wu 2011-07-31 13:07:29 UTC

*** This bug has been marked as a duplicate of bug 215807 ***
Comment 3 Jekyll Wu 2011-07-31 13:13:50 UTC
sorry about the wrong number in previous operation.

*** This bug has been marked as a duplicate of bug 54663 ***
Comment 4 Andrzej 2011-09-06 20:51:32 UTC
still...

konsole behavior is not consistent:
if you:
- open konsole (with one tab) by clicking on konsole icon 
or
- open new tab with "New Tab" button clicked once

.bash_profile IS read

but
if you:
- open konsole with "File" -> "New Tab" and then select a default profile
or
- open new tab with "New Tab" button pressed and then select a default profile

.bash_profile IS NOT read

I use .bash_profile because inside it I can source ~/.bashrc
but when I tried other way around I had problems.
Comment 5 Jekyll Wu 2011-09-07 01:51:31 UTC
I failed to reproduce that inconsistent behavior.

I created a new profile 'Bash' which runs 'bash -l' and set it as default profile, then whenever that profile was used to create a tab/session, ~/.bash_profile was read.

How was konsole initially started? I mean, what did `ps aux| grep konsole` show?

And what is the version of konsole you are using at the moment?

Could you pleas provide clear and sure steps to reproduce that inconsistent behavior?
Comment 6 Andrzej 2011-09-07 20:10:51 UTC
the konsole was started by clicking on konsole icon. (the icon was not modified by me)
the output of `ps aux| grep konsole` is:
andy      1427  2.0  2.1  71116 21984 ?        Sl   21:40   0:00 konsole -e /bin/bash -l

the version of konsole is 2.7

I don't know how else can describe steps. I will attach some screen-shoots.
first 2 screen-shots represents konsole with ~/.bash_profile was read
Comment 7 Andrzej 2011-09-07 20:11:53 UTC
Created attachment 63490 [details]
konsole - opened with icon
Comment 8 Andrzej 2011-09-07 20:12:55 UTC
Created attachment 63491 [details]
konsole - new tab opened with one click
Comment 9 Andrzej 2011-09-07 20:13:58 UTC
Created attachment 63492 [details]
konsole - new tab opened with menu-1
Comment 10 Andrzej 2011-09-07 20:14:24 UTC
Created attachment 63493 [details]
konsole - new tab opened with menu-2
Comment 11 Andrzej 2011-09-07 20:16:03 UTC
Created attachment 63494 [details]
konsole - new tab opened with button pressed=>default profile selected-1
Comment 12 Andrzej 2011-09-07 20:16:32 UTC
Created attachment 63495 [details]
konsole - new tab opened with button pressed=>default profile selected-2
Comment 13 Jekyll Wu 2011-09-07 20:57:35 UTC
Thanks for your feedback, especially the result of 'ps aux| grep konsole'. 

I have a clue about that inconsistent behavior. Could you show me the command specified in your *default* profile(Powłoka in the screenshot)? I guess it is NOT 'bash -l'.If that is the case, changing it to 'bash -l' should eliminate the inconsistency .

The tricky thing is: sometimes, the default profile is not used to create new session. A typical example is when konsole is started in the form of 'konsole -e cmd args'.  In that case, a dynamic profile is created and used as the default to create new session when user does not explictly specify the profile. See bug #211933 for another example.
Comment 14 Andrzej 2011-09-08 23:02:37 UTC
the command is: /bin/bash

and in my case with:
konsole --new-tab
or
ctrl-shift-t
or
ctrl+shift+n

~/.bash_profile was also read


adding '-l' eliminates inconsistency.
Comment 15 Jekyll Wu 2011-09-09 04:54:03 UTC
(In reply to comment #14)
> 

So my guess is correct :)

I think the thing is explained clear enough, so I will close it. If you think that tricky thing is a bug and should be fixed, watch bug #211933.