This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Konsolepart in dolphin not launching bash shell reliably

Tags: None
(comma "," separated)
highsciguy
Registered Member
Posts
84
Karma
0
My konsole is set up such that it launches bash shell by default when I start it. Unfortunately konsolepart in dolphin launches bash only occasionally (I cannot tell what causes this, but sometimes it works, while mostly it does not). It might be related to my environment paths or the custom .bashrc. Which settings can be made to influence or to debug this issue? I have a slightly similar problem (another shell run by a kde application). In kalarm I experience on the same system that bash scripts which work with kalarm on other systems do not work on this one.
My system was updated a few times from older KDE versions and the problems might originate in inconsistent configuration. Maybe I should delete some (which) configuration files and set it up again?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
How exactly is bash failing to launch? Does Konsole give any specific message as to why the shell is failing to start?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
highsciguy
Registered Member
Posts
84
Karma
0
I see a shell window but it does not appear tu be bash and .bashrc is not loaded.
If I run bash manually in this shell I can continue working as usual.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
When that occurs, please provide the output of the following command:
Code: Select all
ps -p $$


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
highsciguy
Registered Member
Posts
84
Karma
0
At present it gives me that it is a bash (I believe to remember that this was not always the case though)

ps -p $$
PID TTY TIME CMD
20091 pts/0 00:00:00 bash

The only apparent difference being that the coloring of the command prompt defined in .bashrc is sometimes not applied and at the same time at least some of the exports like $PATH are not applied (As I mentioned, sometimes it works and sometimes it does not). Maybe it is of relevance that I usually start dolphin using krunner. My .bashrc is a longer file but works reliably if I run konsole or simply bash.
User avatar
google01103
Manager
Posts
6668
Karma
25
could you create a new user and try, this would show that there was something wrong with your config (KDE or bash)


OpenSuse Leap 42.1 x64, Plasma 5.x

User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Where are the shell directives which change the behaviour of your shell? In ~/.bashrc or ~/.profile?
Depending on the location, they may or may not be executed - as different locations are looked at depending on if it is a login or interactive shell.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
highsciguy
Registered Member
Posts
84
Karma
0
They are in .bashrc. Note again that sometimes everything works (in the same kde session). In my .profile I have

# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
If I recall correctly, ~/.profile will only be interpreted by a login shell. Please check the Invocation section of http://linux.die.net/man/1/bash to see if any of the cases mentioned there apply to your use case.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
highsciguy
Registered Member
Posts
84
Karma
0
My problem is a bit to understand what the konsolepart shell in dolphin (and the command line interpreters in other kde applications like kalarm or even krunner) actually is. Not a login shell? Can the type differ, or why does it sometimes interpret .profile (or .bashrc) and sometimes not? And why does it always work with konsole (i.e. how is the konsole shell different)?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Okay, that is interesting - do your custom directives potentially take a while to execute?
I do know that Dolphin at least issues a command to bash to cause it to change into the appropriate directory. If this command were sent too soon, it could interrupt the loading of configuration files.

In terms of the difference between login and interactive shells - this is controlled by the arguments given to bash I believe, so it should be consistent.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
highsciguy
Registered Member
Posts
84
Karma
0
That's very interesting! If you ask me to guess that's likely the case though I don't see why it may take so long. If I execute .bashrc manually it is fast. I remember sometimes seeing the 'cd' command in the konsolepart window of dolphin. I will try later to work with a shortened bashrc.
For kalarm it might indeed be the case that it is not a login shell. So the problem there might be unrelated.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]