Bug 170924 - Short directory format (%d) does not work correctly for all directories
Summary: Short directory format (%d) does not work correctly for all directories
Status: RESOLVED NOT A BUG
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:
Depends on:
Blocks:
 
Reported: 2008-09-12 16:02 UTC by Stefan Becker
Modified: 2008-09-12 20:03 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Becker 2008-09-12 16:02:18 UTC
Version:            (using KDE 4.1.0)
OS:                Linux
Installed from:    Fedora RPMs

For certain directories (bin, lib, tmp, ...) the %d format does not work correctly. Example:

 $ cd $HOME
 -> tab shows "stefanb"   OK
 $ cd bin
 -> tab shows "stefanb/b" WRONG
 $ cd ../tmp
 -> tab shows "stefanb/t" WRONG
 $ cd ../misc
 -> tab shows "misc"      OK
 $ cd bin
 -> tab shows "misc/b"    WRONG

I guess this has something to do with the dirNamesToShorten list in ProcessInfo::formatShortDir().
Comment 1 Robert Knight 2008-09-12 17:41:47 UTC
Hello,

This is not a bug.  It is intended behavior.  Common directory names are shortened to a single letter because they are not useful when telling tabs apart from one another.  

For example, if I have tabs open in:

.../kde4/src
.../<work-project>/src
.../<top-secret-project>/src

Then just showing 'src' as the directory name is not useful.  Instead these names are shortened to a single letter to minimize the tab space taken for when there are a lot of tabs open and the previous name is added.

Smarter behavior would be to show the full text ('src','build') in addition to the the previous directory name when there are a small number of tabs open and then trim these to a single letter when there are more tabs open:

eg:  'kde4/src', '<workproject>/src' with a few tabs open.  Then trimmed to 'kde4/s', '<workproject>/s' when there are lots of tabs open.
Comment 2 Stefan Becker 2008-09-12 20:03:52 UTC
Yeah, just came to the same conclusion. Sorry :-)

When I first saw it I thought my hacking around in the code caused it...

Set to INVALID.