Hi, > today I've had some minor problems regarding Irssi+Eterm using Xterm > title setting sequences. Attached the script which depends on the changes (and a diff against the original version).
-- Alex Beregszaszi <[EMAIL PROTECTED]> (MPlayer Core Developer -- http://www.mplayerhq.hu/)
title.pl
Description: Perl program
--- title.pl.orig Sun Jun 29 20:16:59 2003 +++ title.pl Mon Aug 4 16:38:19 2003 @@ -1,7 +1,7 @@ use Irssi 20020120.0250 (); $VERSION = "3.2"; %IRSSI = ( - authors => 'Timo Sirainen, David Leadbeater', + authors => 'Timo Sirainen, David Leadbeater, Alex Beregszaszi', contact => '[EMAIL PROTECTED], [EMAIL PROTECTED]', name => 'title', description => 'Display configurable title as XTerm title', @@ -34,12 +34,13 @@ sub xterm_topic { my($text) = @_; - + STDERR->autoflush(1); if(Irssi::settings_get_bool('title_screen_window')) { print STDERR "\033k$text\033\\"; }else{ - print STDERR "\033]0;$text\007"; + my $level = Irssi::settings_get_bool('title_icon_name') ? 0 : 2; + print STDERR "\033]$level;$text\007"; } } @@ -130,6 +131,10 @@ refresh_topic(); } +sub cleanup { + xterm_topic(''); +} + Irssi::signal_add_last('window changed', 'refresh_topic'); Irssi::signal_add_last('window item changed', 'refresh_topic'); Irssi::signal_add_last('window server changed', 'refresh_topic'); @@ -137,7 +142,9 @@ Irssi::signal_add_last('channel topic changed', 'topic_changed'); Irssi::signal_add_last('window hilight', 'hilight_win'); Irssi::signal_add_last('setup changed', 'refresh_topic'); +Irssi::signal_add_last('gui exit', 'cleanup'); Irssi::settings_add_str('misc', 'title_string', 'Irssi: [EMAIL PROTECTED]'); Irssi::settings_add_int('misc', 'title_topic_length', 250); Irssi::settings_add_bool('misc', 'title_screen_window', 0); +Irssi::settings_add_bool('misc', 'title_icon_name', 0);