Bug 140700 - Custom session names should not be overwritten by shell escape codes
Summary: Custom session names should not be overwritten by shell escape codes
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 1.6.5
Platform: Fedora RPMs Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-27 03:36 UTC by Douglas E. Warner
Modified: 2012-08-05 20:25 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch to give priority to titles explicitly set by the user (6.68 KB, patch)
2007-01-27 17:29 UTC, Robert Knight
Details
Revised patch. Cleaner code and added documentation. (9.25 KB, patch)
2007-01-27 17:58 UTC, Robert Knight
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Douglas E. Warner 2007-01-27 03:36:13 UTC
Version:           1.6.5 (using KDE KDE 3.5.5)
Installed from:    Fedora RPMs

I've just recently found the escape codes that can be used to dynamically set the session name and love the functionality, but sometimes I still like to manually change the session name.  Unfortunately if I do that the session name gets immediately set back to the value in the escape code as soon as I perform some action (pretty much, press any key).

I'd prefer that if I manually set the session name that it would be preserved - I'm not sure if there would be any way to "clear" the custom session name (maybe the current "clear" button would handle this?).

I'm currently setting my session name dynamically by putting the following in my .bashrc:

export PS1=$PS1"\[\e]30;\h:\W\a\e[28;0t\]"

There is some background in my blog post:
http://www.silfreed.net/blog/398
Comment 1 Robert Knight 2007-01-27 17:29:35 UTC
Created attachment 19442 [details]
Patch to give priority to titles explicitly set by the user

This patch gives priority to titles set explicitly by the user ( by
double-clicking on the tab title and providing a new name ).
Comment 2 Robert Knight 2007-01-27 17:58:17 UTC
Created attachment 19444 [details]
Revised patch.  Cleaner code and added documentation.

Revised patch to give priority to user set titles.  Cleaned up the code and
added documentation to explain the difference between the two titles which can
be set by a terminal program.  Most terminal programs only set the dynamic
title, which is shown alongside the standard session title.  Konsole also
allows terminal programs to replace the standard session title.
Comment 3 Douglas E. Warner 2007-01-27 21:22:31 UTC
If I'm reading the patch correctly, it looks like this takes into account three (maybe four) different types of session names, and handles them in this priority:

1) Default session names which are setup by Konsole when a new session is started (stuff like "shell", "shell #2", etc).
2) Dynamically-set session names from the prompt, similar to what I'm doing above.
3) User-set session names through "rename session" (double-clicking on the session tab, ctrl-alt-s, etc).

Is it possible to checkout Konsole from KDE SVN and compile it independantly?  Or should I just grab KDE 3.5.6 and apply the patch there?  I'd like to just compile Konsole to test out the patch, but not completely replace my distro's KDE installation.

Thanks!
Comment 4 Robert Knight 2007-01-27 22:30:23 UTC
Hello Douglas,

This probably will not work, but you can try this binary:

http://www.robertknight.me.uk/files/kde/konsole-140700-wish.tar.gz

Extract the library to a folder somewhere in your home directory, open a new shell, navigate to that directory and point LD_LIBRARY_PATH there ( eg. "export LD_LIBRARY_PATH=$PWD" ) then run "konsole".  

Failing that, you can get Konsole from the KDE SVN branch.  Install any development packages which your distro provides for KDE (usually kdelibs4-dev or similar) then:

mkdir ~/kde3-test
cd ~/kde3-test
svn co -N svn://anonsvn.kde.org/home/kde/branches/KDE/3.5/kdebase
cd kdebase
svn co svn://anonsvn.kde.org/home/kde/branches/KDE/3.5/kde-common/admin
svn up konsole
make -f Makefile.cvs
./configure --prefix=$PWD/../kde
make && make install
export LD_LIBRARY_PATH=$PWD/../kde/lib
export PATH=$PWD/../kde/bin:$PATH
konsole
Comment 5 Robert Knight 2007-01-27 22:32:58 UTC
Oh, and if the above steps work, you can then apply the patch, repeat the "make && make install" and test the feature.
Comment 6 Kurt Hindenburg 2009-03-15 22:39:14 UTC
Is this patch already in KDE4?
Comment 7 Mathieu Jobin 2009-10-05 16:21:25 UTC
this functionality seems to have disappeared with KDE4
Comment 8 Mathieu Jobin 2009-10-07 20:23:51 UTC
this functionality have disappeared with KDE4

but the priority to user changed text would be still very good feature in KDE4

once bug #179142 is fixed
Comment 9 Kurt Hindenburg 2012-08-05 20:25:31 UTC
I'm fairly sure this is fixed.  re-open if you can reproduce in a late KDE version