1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

Bug 885: Truncate title at 600 bytes, not 1024.

Although xterm allows 1024 bytes, GNU Screen apparently has a lower
limit.
This commit is contained in:
Kalle Olavi Niemitalo 2009-01-01 19:54:35 +00:00 committed by Kalle Olavi Niemitalo
parent 29c34df62e
commit 8d19b87cb1

View File

@ -447,9 +447,16 @@ set_window_title(unsigned char *title, int codepage)
|| (unicode >= 0x7F && unicode < 0xA0))
continue;
/* xterm entirely rejects 1024-byte or longer
* titles. */
if (filtered.length + charlen >= 1024 - 3) {
/* If the title is getting too long, truncate
* it and add an ellipsis.
*
* xterm entirely rejects 1024-byte or longer
* titles. GNU Screen 4.00.03 misparses
* titles longer than 765 bytes, and is unable
* to display the title in hardstatus if the
* title and other stuff together exceed 766
* bytes. So set the limit quite a bit lower. */
if (filtered.length + charlen >= 600 - 3) {
add_to_string(&filtered, "...");
break;
}