Bug 309763

Summary: Title length is ~74 characters maximum.
Product: [Applications] konsole Reporter: kde49534
Component: generalAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED FIXED    
Severity: normal CC: cfeck
Priority: NOR    
Version: 2.8.5   
Target Milestone: ---   
Platform: Slackware   
OS: Linux   
Latest Commit: Version Fixed In: 4.10
Attachments: What the title looks like to me.

Description kde49534 2012-11-08 19:20:16 UTC
The maximum length I can set the title of the window to is 74 characters, and the first 74 characters at that. This is not good when it's showing the current full directory path (%w) and I'm in a deep tree. I think it should be allowed to expand to the maximum size of the whole title bar, and start replacing the leftmost characters with an ellipsis if it goes bigger than that.

Note this is not the tab title, but the window title.

Reproducible: Always

Steps to Reproduce:
1. Enter a deep tree: cd /tmp/1234567890/1234567890/1234567890/1234567890/1234567890/1234567890
2. Observe the window title: "kdeuser@localhost:/tmp/1234567890/1234567890/1234567890/1234567890/1234567"
3. Change to another deeply rooted directory: cd ../foo
Actual Results:  
Observe the window title: "kdeuser@localhost:/tmp/1234567890/1234567890/1234567890/1234567890/1234567"

Expected Results:  
Window title: "kdeuser@localhost:/tmp/1234567890/1234567890/1234567890/1234567890/1234567890/foo"

Some names have been changed to protect the innocent.
Comment 1 Christoph Feck 2012-11-08 21:33:29 UTC
Odd. It works here exactly as you want it, eliding text with "..." in the middle.
Comment 2 kde49534 2012-11-08 21:50:29 UTC
Created attachment 75111 [details]
What the title looks like to me.

In 2.8.5? Using %w? This attachment shows what I seeā€¦
Comment 3 kde49534 2012-11-08 21:52:44 UTC
Another user [url=http://forum.kde.org/viewtopic.php?f=227&t=108609&p=253596]saw something similar[/url].
Comment 4 Christoph Feck 2012-11-08 22:50:00 UTC
I am on master, and used %D to show full path.

%w indeed seems to cut, less than 50 characters here. That's probably simply a copy of the Tab text copied to the window title, but it should be the other way around...
Comment 5 Kurt Hindenburg 2012-11-09 03:26:31 UTC
It appears the max token is 80 so the text received for %w will always be less

Vt102Emulation.h:#define MAX_TOKEN_LENGTH 80

This code is quite old - I'll have to try to figure out why that's there.
Comment 6 Kurt Hindenburg 2012-11-10 20:37:38 UTC
Git commit 38e6c820f574f66e17de712a55dd80de69f02324 by Kurt Hindenburg.
Committed on 10/11/2012 at 19:28.
Pushed by hindenburg into branch 'master'.

Increase length of tokens

Currently, the max length of a token is 80.  This affects the window
title causing the max length of around 74.  The main usage is to allow
a really long window title.
>From what I gather xterm doesn't have a limit.  If needed, this #
could be increased.

FIXED-IN: 4.10

M  +1    -1    src/Vt102Emulation.h

http://commits.kde.org/konsole/38e6c820f574f66e17de712a55dd80de69f02324