The current implementation truncates the tab text when it is too big to fit on the screen. However, for thos of us who like to use something like
`hostname`:`/bin/pwd`
as the title of the window (and thus the tab text as well) all the tab titles get truncated to the same info. In fact, the interesting part tends to be the prefix, not the suffix. Here is a patch that uses the last N chars, rather than the first N chars. Any interest in including this (possibly with adding an option for people who like it the current way)?
Thanks.
Jim
*** src/tabbar.c 2006-12-28 19:25:10.000000000 -0400
--- src/tabbar.c.orig 2006-12-26 18:15:47.000000000 -0400
***************
*** 549,560 ****
* If % interpolation was not possible, or returned a 1 byte long
* string, then just copy the title over.
*/
! int offset = STRLEN(PVTS(r,tnum)->tab_title) - r->TermWin.maxTabWidth;
!
! if (offset < 0)
! offset = 0;
!
! STRNCPY(str, PVTS(r,tnum)->tab_title + offset, r->TermWin.maxTabWidth);
str[r->TermWin.maxTabWidth] = '\0';
}
--- 549,555 ----
* If % interpolation was not possible, or returned a 1 byte long
* string, then just copy the title over.
*/
! STRNCPY( str, PVTS(r,tnum)->tab_title , r->TermWin.maxTabWidth );
str[r->TermWin.maxTabWidth] = '\0';
}
Logged In: YES
user_id=862337
Originator: NO
Hmm. This gets tricky. Firstly with Xft the number of characters in the tab title can vary. So where to truncate becomes an issue!
Secondly, perhaps what you want can already be achieved using the titleFormat option. This allows for you to have your favourite sticky prefixes, suffixes, etc.
If however you want to add truncation as a % interpolated sequence in the titleFormat option (e.g. say "%T-3,$" to represent the last three characters in the title), then that would be a little more flexible.
It however still does not solve the problem under Xft, since you still would not know how much to truncate...
PS: If you follow this up on the dev mailing list, we can discuss the solution further. Or if you find the titleFormat option already does what you need, just close this :).