Bug 190281 - tab title format %d causes working directory /tmp displayed as /t in tab title
Summary: tab title format %d causes working directory /tmp displayed as /t in tab title
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
: 190279 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-04-21 19:21 UTC by Michael Eager
Modified: 2012-02-29 01:13 UTC (History)
3 users (show)

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


Attachments
konsolerc contents and incorrect tab text (62.97 KB, image/png)
2009-04-22 23:46 UTC, Michael Eager
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Eager 2009-04-21 19:21:01 UTC
Version:            (using KDE 4.2.1)
OS:                Linux
Installed from:    Fedora RPMs

This is a duplicate of 167590/1777523.  

I'm submitting it because the explanation of how this is a "feature" makes little sense.  

/tmp is a complete path.  There is no ambiguity, lack of clarity, or possibility of confusion when displaying the full name.  Shorting the name to /t is simply confusing.  

This is a mis-feature.  If the shortened sub-directory names are in the same directory, then this creates confusion rather than clarity.  Truncating ~/tmp to <userid>/t is unhelpful at best, confusing at worst,
because it's not obvious what the 't' is supposed to represent.  

Where are the "special names" described?  

At a minimum, this mis-feature should be user configurable and one which can be disabled.
Comment 1 Robert Knight 2009-04-21 22:58:17 UTC
> I'm submitting it because the explanation
> of how this is a "feature" makes little sense.  

In the case of /tmp, /usr - I take your point.  When you have a bunch of tabs opened in /home/name/myproject/src, /home/name/myproject/build, /home/name/myproject/build/tmp, /home/name/anotherproject/doc it starts to make sense because you can differentiate between the tabs without them taking up too much space.

I think when I first added this it would include the previous directory name in the 'short directory name' (%d) format if the current directory was in a list of common directory names - with no shortening of the common name.  So you'd see myproject/src, myproject/build, myproject/build/tmp in the above examples.  That makes the tabs quite wide however and I didn't want to have to scroll through the tabs.  Eliding the text to shorten the tab text either leaves you with ("myproj...") on each tab which is not very helpful or (".uild/src", "..uild/tmp") which is not very helpful either.  Better suggestions welcome.

> At a minimum, this mis-feature should be user configurable
> and one which can be disabled

No - configuration must not be used as a way of avoiding decision making on a feature.  Options are (generally) there for when significant numbers of users have conflicting preferences for a particular feature or when the software cannot automatically work out the right setup for some feature - like the color scheme of the terminal or the key bindings needed to interoperate with certain programs.
Comment 2 Robert Knight 2009-04-21 22:59:25 UTC
*** Bug 190279 has been marked as a duplicate of this bug. ***
Comment 3 Michael Eager 2009-04-22 05:59:50 UTC
> No - configuration must not be used as a way of avoiding decision making on a
> feature.

Well, I consider this to be less a feature and more of a confusion.  You have your list of preferred abbreviations for a select set of directories.  As an aside: where are these special names and their abbreviations defined?  

I have a different list of preferred abbreviations for the directory names which I use.  What you name "src," I might name "source".  Someone else might have yet a different set of directories, perhaps in a different language.  This seems exactly where configuration should be used.  Configuration would permit you to have what you consider to be a useful feature and allow me to avoid something which I find confusing and distracting.  

If you don't what this functionality to be configurable, then my recommendation would be to remove it.
Comment 4 Robert Knight 2009-04-22 11:53:54 UTC
The list of directory names which are shortened does have a hidden configuration option which probably ought to be exposed in the UI.  What I meant is that we should not be thinking "if we cannot agree on how feature X should be implemented, add a preference".

There is a hard-coded list of directory names in the source (ProcessInfo.cpp:131) which can be over-ridden using the CommonDirNames preference in ~/.kde/share/config/konsolerc.  Adding the line:

CommonDirNames=

To this file should turn the shortening off.

> You have your list of preferred abbreviations for a select set of directories.

The list is taken from a sampling of common directory names in Unix systems.
Comment 5 Michael Eager 2009-04-22 20:17:43 UTC
Thanks.  Where is this supposed to go in the konsolerc file?  Nothing seems to change when I add this to either global or [MainWindows] options.
Comment 6 Robert Knight 2009-04-22 23:04:41 UTC
Ah sorry - it belongs under [ProcessInfo]
Comment 7 Michael Eager 2009-04-22 23:45:13 UTC
That doesn't seem to work either.  See attached screenshot.
Comment 8 Michael Eager 2009-04-22 23:46:07 UTC
Created attachment 33018 [details]
konsolerc contents and incorrect tab text
Comment 9 Robert Knight 2009-04-22 23:55:14 UTC
Works for me.  I assume Fedora is putting the config in ~/.kde and not something else like ~/.kde4.  Also, after changing the config file contents you will need to either:

1.  Start a new Konsole instance from the terminal (by entering "konsole" and pressing return)

OR

2.  Close all existing Konsole windows and start a new one from the GUI (eg. Alt+F2, Kickoff Menu)

To see the effects.
Comment 10 Dario Andres 2009-06-21 22:12:35 UTC
Should this be merged with bug 167590 ? Thanks
Comment 11 Robert Knight 2009-06-21 23:29:55 UTC
It is a duplicate but I'd suggest leaving this open since implementing a UI to control the feature would be a good idea.
Comment 12 Jekyll Wu 2011-07-28 14:34:40 UTC
Another un-documented and confusing feature of konsole :)

IMHO, it should be disabled by default, instead of the opposite.
Comment 13 Kurt Hindenburg 2011-07-29 15:09:29 UTC
#12 yea I tend to agree;  this 'shorten' dir names is something Robert put in.  I'm not sure having it as the default is a good idea either.
Comment 14 Robert Knight 2011-07-30 13:37:18 UTC
> IMHO, it should be disabled by default, instead of the opposite.

I would be OK with that, but I do use this feature myself, so I would like an option to keep the current behavior.
Comment 15 Kurt Hindenburg 2011-07-31 19:45:52 UTC
Git commit febd3c63da2cbaa9d99a9f2d1c7264de58d6bd7d by Kurt Hindenburg.
Committed on 31/07/2011 at 21:42.
Pushed by hindenburg into branch 'master'.

Change the default LocalTabTitleFormat to use %D instead of %d

%d will shorten the directory name whereas %D will not.  For some
users, having %d as the default is confusing as they don't understand
why some directories are not displaying correctly in the tab text.
Currently there is no UI to examine or change which folder names will be
shorten.

CCBUG: 190281

M  +1    -1    src/Profile.cpp

http://commits.kde.org/konsole/febd3c63da2cbaa9d99a9f2d1c7264de58d6bd7d
Comment 16 Jekyll Wu 2012-02-25 20:17:14 UTC
Git commit 5a936adb2005c4da88b457f4b6625dc427a878e3 by Jekyll Wu.
Committed on 25/02/2012 at 20:29.
Pushed by jekyllwu into branch 'master'.

Disable the advanced feature of "CommonDirNames" for "%d" by default

The main consideration is it is more often confusing than helpful for
average users, especially when this feature was hidden, undocumented and
enabled by default.

The "CommonDirNames" list in the code is now empty by default , instead
of a list of hardcoded common names.

To enable and customize this advanced and potentally confusing feature,
edit $KDEHOME/usr/share/config/konsolerc and add the following lines:

    [ProcessInfo]
    CommonDirNames=name1,name2,name3...

For konsolepart users, edit the config file of the hosting application.

I'll add related information for this hidden & advanced feature into
handbook later.
FIXED-IN:4.9.0

REVIEW: 103949
CCMAIL: robertknight@gmail.com

M  +1    -9    src/ProcessInfo.cpp

http://commits.kde.org/konsole/5a936adb2005c4da88b457f4b6625dc427a878e3
Comment 17 Michael Eager 2012-02-29 01:13:01 UTC
Thanks for making the change.  Not quite three years from report to resolution.