Bug 187676

Summary: execute command on tab startup
Product: [Applications] konsole Reporter: Caleb Cushing <xenoterracide>
Component: generalAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED NOT A BUG    
Severity: wishlist CC: robertknight
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Unspecified   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Caleb Cushing 2009-03-20 06:37:29 UTC
Version:            (using KDE 4.2.1)
Installed from:    Gentoo Packages

ok, konsole remembers tab names on startup, and last directory on startup. it'd be really nice if one could program a tab to execute a command on startup, and this might be different for each tab. such as su - or my ingenious idea of being able to source different shell startup files for example I could have a different ~/.bashrc for each tab. I think the possibilities with this are endless.
Comment 1 Kurt Hindenburg 2009-03-20 06:53:54 UTC
Have you looked at profiles's Command entry?  For example, I have one that has 'sux - kdetrunk'  (sux is similiar to su).  You should be able to do lots with profiles.  And if you use KDE's session management, the next time you login they should all appear as you left them.
Comment 2 Caleb Cushing 2009-03-20 07:03:53 UTC
hmm... never thought of it... I assume konsole remembers each tabs profile on startup?

*goes to test it out...
Comment 3 Robert Knight 2009-03-20 11:27:29 UTC
> I assume konsole remembers each tabs profile on startup?

It does in KDE 4.2
Comment 4 Caleb Cushing 2009-03-22 06:03:47 UTC
I think this'll mostly do what I need, I'm gonna have to to work around some of it's behavior...

there doesn't happen to be anything like 'tab_id' where tab_id is a unique number representing the tab that can be retrieved from the shell? is there?
Comment 5 Robert Knight 2009-03-22 11:29:48 UTC
The environment variable $KONSOLE_DBUS_SESSION contains a string which will be unique to that tab (or more accurately, that session) of the form:

/Sessions/N

In Bash and probably other shells, you can get the process id of the shell using:

$$

(eg. echo $$)
Comment 6 Caleb Cushing 2009-03-24 10:34:47 UTC
the profile thing works well enough for what I need, at least with a few bash hacks too. resolving invalid