Re: xterm_title patch 898

* Thomas Zajic <zlatko gmx at> [Tue, 07 Jan 2003]:
> Now that's strange, because AFAICT it _does_ report the proper title, or
> at least mc is _somehow_ able to restore it upon exit. Do you have some
> fallback(s) in place to get the title, ie. something other than what you
> are trying to do within the 5 seconds?

Well maybe there is a bug in the code and I just can't see it, but
it works for me.

seen_esc = 0;
while (i < sizeof(title) && read(tty, &ch, 1) > 0) {
    /* read and discard characters until we get the ESC character
       which starts the title response of the terminal */
    if (seen_esc == 0) { 
        if (ch == '\033') 
            seen_esc = 1;
    /* This character terminates the title response
       according to the xterm control sequence specification.
       Stop reading - this should prevent the delay */
    if (ch == '\x9c')  /* ST */

    /* append a character of the title response to the buffer */
    title[i++] = ch;

Tomas Styblo <tripie cpan org>

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]