--- rxvt-unicode/src/command.C 2005/12/21 14:19:19 1.212 +++ rxvt-unicode/src/command.C 2005/12/31 16:40:28 1.218 @@ -143,13 +143,13 @@ for (;;) { - const line_t &l = ROW(-view_start); + const line_t &l = ROW(y - view_start); text_t t = l.t[x]; if (t != NOCHAR || !x) { - iso14755_51 (l.t[x], l.r[x]); + iso14755_51 (l.t[x], l.r[x], x, y); iso14755buf = ISO_14755_54; break; } @@ -159,10 +159,10 @@ } #endif -#if ENABLE_OVERLAY void -rxvt_term::iso14755_51 (unicode_t ch, rend_t r) +rxvt_term::iso14755_51 (unicode_t ch, rend_t r, int x, int y) { +#if ENABLE_OVERLAY rxvt_fontset *fs = FONTSET (r); rxvt_font *f = (*fs)[fs->find_font (ch)]; wchar_t *chr, *alloc, ch2, *fname; @@ -170,7 +170,7 @@ fname = rxvt_utf8towcs (f->name); -#if ENABLE_COMBINING +# if ENABLE_COMBINING if (IS_COMPOSE (ch)) { len = rxvt_composite.expand (ch, 0); @@ -178,7 +178,7 @@ rxvt_composite.expand (ch, chr); } else -#endif +# endif { ch2 = ch; @@ -187,9 +187,30 @@ len = 1; } + char attr[80]; // plenty + + sprintf (attr, "%08x = fg %d bg %d%s%s%s%s%s%s", + (int)r, + fgcolor_of (r), bgcolor_of (r), + r & RS_Bold ? " bold" : "", + r & RS_Italic ? " italic" : "", + r & RS_Blink ? " blink" : "", + r & RS_RVid ? " rvid" : "", + r & RS_Uline ? " uline" : "", + r & RS_Careful ? " careful" : ""); + int width = wcswidth (fname, wcslen (fname)); - scr_overlay_new (0, -1, width < 8+5 ? 8+5 : width, len + 1); + max_it (width, 8+5); // for char + hey + max_it (width, strlen (attr)); + + if (y >= 0) + { + y = (y >= nrow - len - 4 && x < width + 2) ? 0 : -1; + x = 0; + } + + scr_overlay_new (x, y, width, len + 2); r = SET_STYLE (OVERLAY_RSTYLE, GET_STYLE (r)); @@ -202,24 +223,25 @@ sprintf (buf, "%8x", ch); scr_overlay_set (0, y, buf); scr_overlay_set (9, y, '='); -#if !UNICODE3 +# if !UNICODE3 if (ch >= 0x10000) ch = 0xfffd; -#endif +# endif scr_overlay_set (11, y, ch, r); scr_overlay_set (12, y, NOCHAR, r); } - scr_overlay_set (0, len, fname); + scr_overlay_set (0, len , attr); + scr_overlay_set (0, len + 1, fname); free (fname); -#if ENABLE_COMBINING +# if ENABLE_COMBINING if (alloc) delete [] alloc; +# endif #endif } -#endif void rxvt_term::commit_iso14755 () @@ -1069,8 +1091,13 @@ cmdbuf_endp += n; return true; } - else if (n < 0 && errno != EAGAIN) - destroy (); + else if ((n < 0 && errno != EAGAIN && errno != EINTR) || n == 0) + { + pty_ev.stop (); + + if (!(options & Opt_hold)) + destroy (); + } return false; } @@ -4374,8 +4401,7 @@ memmove (v_buffer, v_buffer + written, v_buflen); } else if (written != -1 || (errno != EAGAIN && errno != EINTR)) - // original code just ignores this... - destroy (); + pty_ev.set (EVENT_READ); } /*----------------------- end-of-file (C source) -----------------------*/