Bug 391255

Summary: Konsole within Dolphin panel) does not read .bashrc when a closed activity is resumed
Product: [Applications] konsole Reporter: Michael Heidelbach <ottwolt>
Component: generalAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED WORKSFORME    
Severity: normal CC: a.samirh78, justin.zobel, nate, ottwolt
Priority: NOR    
Version First Reported In: 17.12.2   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Michael Heidelbach 2018-03-01 12:26:15 UTC
Not sure if dolphin really is the culprit here. I just observed this:

Situation:
Activity 'Development', dolphin open, konsole panel active
2 aliases in ~/.bashrc 'cb' and 'cs'

- Close/Stop activity 'Development'
- Open/Start it again.
Everthing looks as it should but in konsole panel aliases do not work.
$ exit
F4
Aliases are back. Meaning: Now ~/.bashrc was processed.
Comment 1 Nate Graham 2018-03-01 23:01:26 UTC
Starting with Konsole
Comment 2 Ahmad Samir 2018-03-04 12:27:28 UTC
I couldn't reproduce this; here are the steps I followed:
- Create two activities
- open dolphin in one of them and open the terminal panel
- edit .bashrc and add an alias
- stop the activity and start it again, the alias is in effect
Comment 3 Michael Heidelbach 2018-03-04 15:26:03 UTC
(In reply to Ahmad Samir from comment #2)
> I couldn't reproduce this

That is most likely due to neon putting these lines into ~/.profile
if [ -n "$BASH_VERSION" ]; then
  if [ -f "$HOME/.bashrc" ]; then
    . "$HOME/.bashrc"
  fi
fi
Comment 4 Ahmad Samir 2018-03-04 17:29:31 UTC
BASH executes commands in ~/.profile when it's invoked as a login shell. However if bash is invoked as an interactive non-login shell it executes commands in ~/.bashrc.

So it follows that when the dolphin terminal panel is shown bash will execute commands in ~/.bashrc; when an activity is stopped then resumed the bash process (and the dolphin process too) for that panel is terminated and a new one is started.

FWIW, if I edit .bashrc and then hide -> show the terminal panel new commands in .bashrc aren't executed, which makes sense as dolphin doesn't terminate the bash process it started when the terminal panel was first shown (the output in the terminal panel is preserved if you hide then show that panel).
Comment 5 Justin Zobel 2020-11-03 02:08:45 UTC
(In reply to Michael Heidelbach from comment #3)
> (In reply to Ahmad Samir from comment #2)
> > I couldn't reproduce this
> 
> That is most likely due to neon putting these lines into ~/.profile
> if [ -n "$BASH_VERSION" ]; then
>   if [ -f "$HOME/.bashrc" ]; then
>     . "$HOME/.bashrc"
>   fi
> fi

Does removing that fix the issue?
Comment 6 Bug Janitor Service 2020-11-18 04:33:48 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 7 Bug Janitor Service 2020-12-03 04:34:04 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!