Bug 187676 - execute command on tab startup
Summary: execute command on tab startup
Status: RESOLVED NOT A BUG
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Unspecified
: NOR wishlist
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-20 06:37 UTC by Caleb Cushing
Modified: 2009-03-24 10:34 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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