ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/command.C
(Generate patch)

Comparing rxvt-unicode/src/command.C (file contents):
Revision 1.212 by root, Wed Dec 21 14:19:19 2005 UTC vs.
Revision 1.226 by root, Sun Jan 1 15:03:49 2006 UTC

48#include "../config.h" /* NECESSARY */ 48#include "../config.h" /* NECESSARY */
49#include "rxvt.h" /* NECESSARY */ 49#include "rxvt.h" /* NECESSARY */
50#include "version.h" 50#include "version.h"
51#include "command.h" 51#include "command.h"
52 52
53#if HAVE_SCHED_YIELD
54# include <sched.h>
55#endif
56
53#ifdef KEYSYM_RESOURCE 57#ifdef KEYSYM_RESOURCE
54# include "keyboard.h" 58# include "keyboard.h"
55#endif 59#endif
56 60
57#include <csignal> 61#include <csignal>
141 || !IN_RANGE_EXC (y, 0, nrow)) 145 || !IN_RANGE_EXC (y, 0, nrow))
142 return; 146 return;
143 147
144 for (;;) 148 for (;;)
145 { 149 {
146 const line_t &l = ROW(-view_start); 150 const line_t &l = ROW(y - view_start);
147 151
148 text_t t = l.t[x]; 152 text_t t = l.t[x];
149 153
150 if (t != NOCHAR || !x) 154 if (t != NOCHAR || !x)
151 { 155 {
152 iso14755_51 (l.t[x], l.r[x]); 156 iso14755_51 (l.t[x], l.r[x], x, y);
153 iso14755buf = ISO_14755_54; 157 iso14755buf = ISO_14755_54;
154 break; 158 break;
155 } 159 }
156 160
157 x--; 161 x--;
158 } 162 }
159} 163}
160#endif
161 164
162#if ENABLE_OVERLAY
163void 165void
164rxvt_term::iso14755_51 (unicode_t ch, rend_t r) 166rxvt_term::iso14755_51 (unicode_t ch, rend_t r, int x, int y)
165{ 167{
166 rxvt_fontset *fs = FONTSET (r); 168 rxvt_fontset *fs = FONTSET (r);
167 rxvt_font *f = (*fs)[fs->find_font (ch)]; 169 rxvt_font *f = (*fs)[fs->find_font (ch)];
168 wchar_t *chr, *alloc, ch2, *fname; 170 wchar_t *chr, *alloc, ch2, *fname;
169 int len; 171 int len;
170 172
171 fname = rxvt_utf8towcs (f->name); 173 fname = rxvt_utf8towcs (f->name);
172 174
173#if ENABLE_COMBINING 175# if ENABLE_COMBINING
174 if (IS_COMPOSE (ch)) 176 if (IS_COMPOSE (ch))
175 { 177 {
176 len = rxvt_composite.expand (ch, 0); 178 len = rxvt_composite.expand (ch, 0);
177 alloc = chr = new wchar_t[len]; 179 alloc = chr = new wchar_t[len];
178 rxvt_composite.expand (ch, chr); 180 rxvt_composite.expand (ch, chr);
179 } 181 }
180 else 182 else
181#endif 183# endif
182 { 184 {
183 ch2 = ch; 185 ch2 = ch;
184 186
185 alloc = 0; 187 alloc = 0;
186 chr = &ch2; 188 chr = &ch2;
187 len = 1; 189 len = 1;
188 } 190 }
189 191
192 char attr[80]; // plenty
193
194 sprintf (attr, "%08x = fg %d bg %d%s%s%s%s%s%s",
195 (int)r,
196 fgcolor_of (r), bgcolor_of (r),
197 r & RS_Bold ? " bold" : "",
198 r & RS_Italic ? " italic" : "",
199 r & RS_Blink ? " blink" : "",
200 r & RS_RVid ? " rvid" : "",
201 r & RS_Uline ? " uline" : "",
202 r & RS_Careful ? " careful" : "");
203
190 int width = wcswidth (fname, wcslen (fname)); 204 int width = wcswidth (fname, wcslen (fname));
191 205
192 scr_overlay_new (0, -1, width < 8+5 ? 8+5 : width, len + 1); 206 max_it (width, 8+5); // for char + hey
207 max_it (width, strlen (attr));
208
209 if (y >= 0)
210 {
211 y = (y >= nrow - len - 4 && x < width + 2) ? 0 : -1;
212 x = 0;
213 }
214
215 scr_overlay_new (x, y, width, len + 2);
193 216
194 r = SET_STYLE (OVERLAY_RSTYLE, GET_STYLE (r)); 217 r = SET_STYLE (OVERLAY_RSTYLE, GET_STYLE (r));
195 218
196 for (int y = 0; y < len; y++) 219 for (int y = 0; y < len; y++)
197 { 220 {
200 ch = *chr++; 223 ch = *chr++;
201 224
202 sprintf (buf, "%8x", ch); 225 sprintf (buf, "%8x", ch);
203 scr_overlay_set (0, y, buf); 226 scr_overlay_set (0, y, buf);
204 scr_overlay_set (9, y, '='); 227 scr_overlay_set (9, y, '=');
205#if !UNICODE3 228# if !UNICODE3
206 if (ch >= 0x10000) 229 if (ch >= 0x10000)
207 ch = 0xfffd; 230 ch = 0xfffd;
208#endif 231# endif
209 scr_overlay_set (11, y, ch, r); 232 scr_overlay_set (11, y, ch, r);
210 scr_overlay_set (12, y, NOCHAR, r); 233 scr_overlay_set (12, y, NOCHAR, r);
211 } 234 }
212 235
236 scr_overlay_set (0, len , attr);
213 scr_overlay_set (0, len, fname); 237 scr_overlay_set (0, len + 1, fname);
214 238
215 free (fname); 239 free (fname);
216 240
217#if ENABLE_COMBINING 241# if ENABLE_COMBINING
218 if (alloc) 242 if (alloc)
219 delete [] alloc; 243 delete [] alloc;
220#endif 244# endif
221} 245}
222#endif 246#endif
223 247
224void 248void
225rxvt_term::commit_iso14755 () 249rxvt_term::commit_iso14755 ()
844 } 868 }
845 869
846 if (len <= 0) 870 if (len <= 0)
847 return; /* not mapped */ 871 return; /* not mapped */
848 872
849 if (options & Opt_scrollTtyKeypress) 873 if (OPTION (Opt_scrollTtyKeypress))
850 if (view_start) 874 if (view_start)
851 { 875 {
852 view_start = 0; 876 view_start = 0;
853 want_refresh = 1; 877 want_refresh = 1;
854 } 878 }
960 SET_LOCALE (locale); 984 SET_LOCALE (locale);
961 985
962 display->flush (); 986 display->flush ();
963 987
964 if (want_refresh && !flush_ev.active) 988 if (want_refresh && !flush_ev.active)
965 flush_ev.start (NOW + 0.01); 989 flush_ev.start (NOW + 1. / 60.); // refresh at max. 60 hz normally
966} 990}
967 991
968void 992void
969rxvt_term::flush_cb (time_watcher &w) 993rxvt_term::flush_cb (time_watcher &w)
970{ 994{
1060 1084
1061 memmove (cmdbuf_base, cmdbuf_ptr, n); 1085 memmove (cmdbuf_base, cmdbuf_ptr, n);
1062 cmdbuf_ptr = cmdbuf_base; 1086 cmdbuf_ptr = cmdbuf_base;
1063 cmdbuf_endp = cmdbuf_ptr + n; 1087 cmdbuf_endp = cmdbuf_ptr + n;
1064 1088
1065 n = read (pty.pty, cmdbuf_endp, CBUFSIZ - n); 1089 ssize_t r = read (pty.pty, cmdbuf_endp, CBUFSIZ - n);
1066 1090
1067 if (n > 0) 1091 if (r > 0)
1068 { 1092 {
1069 cmdbuf_endp += n; 1093 cmdbuf_endp += r;
1070 return true; 1094 return true;
1071 } 1095 }
1072 else if (n < 0 && errno != EAGAIN) 1096 else if (r < 0 && (errno == EAGAIN || errno == EINTR))
1097 {
1098#if HAVE_SCHED_YIELD
1099 sched_yield ();
1100#endif
1101 }
1102 else
1103 {
1104 pty_ev.stop ();
1105
1106 if (!OPTION (Opt_hold))
1073 destroy (); 1107 destroy ();
1108 }
1074 1109
1075 return false; 1110 return false;
1076} 1111}
1077 1112
1078void 1113void
1098 recolour_cursor (); 1133 recolour_cursor ();
1099 1134
1100#ifdef POINTER_BLANK 1135#ifdef POINTER_BLANK
1101 hidden_pointer = 0; 1136 hidden_pointer = 0;
1102 1137
1103 if (options & Opt_pointerBlank) 1138 if (OPTION (Opt_pointerBlank))
1104 pointer_ev.start (NOW + pointerBlankDelay); 1139 pointer_ev.start (NOW + pointerBlankDelay);
1105#endif 1140#endif
1106} 1141}
1107 1142
1108#ifdef POINTER_BLANK 1143#ifdef POINTER_BLANK
1109void 1144void
1110rxvt_term::pointer_blank () 1145rxvt_term::pointer_blank ()
1111{ 1146{
1112 if (! (options & Opt_pointerBlank)) 1147 if (! OPTION (Opt_pointerBlank))
1113 return; 1148 return;
1114 1149
1115 XDefineCursor (display->display, vt, display->blank_cursor); 1150 XDefineCursor (display->display, vt, display->blank_cursor);
1116 XFlush (display->display); 1151 XFlush (display->display);
1117 1152
1215 1250
1216 SET_R (this); 1251 SET_R (this);
1217 SET_LOCALE (locale); 1252 SET_LOCALE (locale);
1218 1253
1219#if defined(CURSOR_BLINK) 1254#if defined(CURSOR_BLINK)
1220 if ((options & Opt_cursorBlink) && ev.type == KeyPress) 1255 if (OPTION (Opt_cursorBlink) && ev.type == KeyPress)
1221 { 1256 {
1222 if (hidden_cursor) 1257 if (hidden_cursor)
1223 { 1258 {
1224 hidden_cursor = 0; 1259 hidden_cursor = 0;
1225 want_refresh = 1; 1260 want_refresh = 1;
1228 cursor_blink_ev.start (NOW + BLINK_INTERVAL); 1263 cursor_blink_ev.start (NOW + BLINK_INTERVAL);
1229 } 1264 }
1230#endif 1265#endif
1231 1266
1232#if defined(POINTER_BLANK) 1267#if defined(POINTER_BLANK)
1233 if ((options & Opt_pointerBlank) && pointerBlankDelay > 0) 1268 if (OPTION (Opt_pointerBlank) && pointerBlankDelay > 0)
1234 { 1269 {
1235 if (ev.type == MotionNotify 1270 if (ev.type == MotionNotify
1236 || ev.type == ButtonPress 1271 || ev.type == ButtonPress
1237 || ev.type == ButtonRelease) 1272 || ev.type == ButtonRelease)
1238 if (hidden_pointer) 1273 if (hidden_pointer)
1434 seen_resize = 1; 1469 seen_resize = 1;
1435 resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1); 1470 resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1);
1436 } 1471 }
1437 1472
1438#ifdef TRANSPARENT /* XXX: maybe not needed - leave in for now */ 1473#ifdef TRANSPARENT /* XXX: maybe not needed - leave in for now */
1439 if (options & Opt_transparent) 1474 if (OPTION (Opt_transparent))
1440 check_our_parents (); 1475 check_our_parents ();
1441#endif 1476#endif
1442 } 1477 }
1443 break; 1478 break;
1444 1479
1653 IMSetStatusPosition (); 1688 IMSetStatusPosition ();
1654 XSetICFocus (Input_Context); 1689 XSetICFocus (Input_Context);
1655 } 1690 }
1656#endif 1691#endif
1657#if CURSOR_BLINK 1692#if CURSOR_BLINK
1658 if (options & Opt_cursorBlink) 1693 if (OPTION (Opt_cursorBlink))
1659 cursor_blink_ev.start (NOW + BLINK_INTERVAL); 1694 cursor_blink_ev.start (NOW + BLINK_INTERVAL);
1660#endif 1695#endif
1661#if OFF_FOCUS_FADING 1696#if OFF_FOCUS_FADING
1662 if (rs[Rs_fade]) 1697 if (rs[Rs_fade])
1663 { 1698 {
1685#if USE_XIM 1720#if USE_XIM
1686 if (Input_Context != NULL) 1721 if (Input_Context != NULL)
1687 XUnsetICFocus (Input_Context); 1722 XUnsetICFocus (Input_Context);
1688#endif 1723#endif
1689#if CURSOR_BLINK 1724#if CURSOR_BLINK
1690 if (options & Opt_cursorBlink) 1725 if (OPTION (Opt_cursorBlink))
1691 cursor_blink_ev.stop (); 1726 cursor_blink_ev.stop ();
1692 hidden_cursor = 0; 1727 hidden_cursor = 0;
1693#endif 1728#endif
1694#if OFF_FOCUS_FADING 1729#if OFF_FOCUS_FADING
1695 if (rs[Rs_fade]) 1730 if (rs[Rs_fade])
1719 && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID]) 1754 && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID])
1720 return; 1755 return;
1721 1756
1722 /* FALLTHROUGH */ 1757 /* FALLTHROUGH */
1723 case ReparentNotify: 1758 case ReparentNotify:
1724 if ((options & Opt_transparent) && check_our_parents () && am_transparent) 1759 if (OPTION (Opt_transparent) && check_our_parents () && am_transparent)
1725 want_refresh = want_full_refresh = 1; 1760 want_refresh = want_full_refresh = 1;
1726 break; 1761 break;
1727 } 1762 }
1728} 1763}
1729#endif 1764#endif
2071 2106
2072 v = ev.button == Button4 ? UP : DN; 2107 v = ev.button == Button4 ? UP : DN;
2073 2108
2074 if (ev.state & ShiftMask) 2109 if (ev.state & ShiftMask)
2075 i = 1; 2110 i = 1;
2076 else if (options & Opt_mouseWheelScrollPage) 2111 else if (OPTION (Opt_mouseWheelScrollPage))
2077 i = nrow - 1; 2112 i = nrow - 1;
2078 else 2113 else
2079 i = 5; 2114 i = 5;
2080 2115
2081# ifdef MOUSE_SLIP_WHEELING 2116# ifdef MOUSE_SLIP_WHEELING
2367 XWindowAttributes wattr, wrootattr; 2402 XWindowAttributes wattr, wrootattr;
2368 dDisp; 2403 dDisp;
2369 2404
2370 pchanged = 0; 2405 pchanged = 0;
2371 2406
2372 if (!(options & Opt_transparent)) 2407 if (!OPTION (Opt_transparent))
2373 return pchanged; /* Don't try any more */ 2408 return pchanged; /* Don't try any more */
2374 2409
2375 XGetWindowAttributes (disp, display->root, &wrootattr); 2410 XGetWindowAttributes (disp, display->root, &wrootattr);
2376 rootdepth = wrootattr.depth; 2411 rootdepth = wrootattr.depth;
2377 2412
2655 if (ch == C0_LF) 2690 if (ch == C0_LF)
2656 nlines++; 2691 nlines++;
2657 2692
2658 refresh_count++; 2693 refresh_count++;
2659 2694
2660 if (!(options & Opt_jumpScroll) 2695 if (!OPTION (Opt_jumpScroll)
2661 || (refresh_count >= refresh_limit * (nrow - 1))) 2696 || (refresh_count >= refresh_limit * (nrow - 1)))
2662 { 2697 {
2663 refreshnow = true; 2698 refreshnow = true;
2699 refresh_count = 0;
2664 ch = NOCHAR; 2700 ch = NOCHAR;
2665 break; 2701 break;
2666 } 2702 }
2667 2703
2668 // scr_add_lines only works for nlines <= nrow - 1. 2704 // scr_add_lines only works for nlines <= nrow - 1.
2699 * the number of pages between refreshes is refresh_limit, which 2735 * the number of pages between refreshes is refresh_limit, which
2700 * is incremented here because we must be doing flat-out scrolling. 2736 * is incremented here because we must be doing flat-out scrolling.
2701 */ 2737 */
2702 if (refreshnow) 2738 if (refreshnow)
2703 { 2739 {
2704 if ((options & Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD) 2740 if (OPTION (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD)
2705 refresh_limit++; 2741 refresh_limit++;
2706 else 2742 else
2707 { 2743 {
2708 flag = true; 2744 flag = true;
2709 scr_refresh (refresh_type); 2745 scr_refresh (refresh_type);
2746 flush_ev.stop ();
2710 } 2747 }
2711 } 2748 }
2712 2749
2713 } 2750 }
2714 else 2751 else
3373 break; 3410 break;
3374 case 6: /* CPR requested */ 3411 case 6: /* CPR requested */
3375 scr_report_position (); 3412 scr_report_position ();
3376 break; 3413 break;
3377 case 7: /* unofficial extension */ 3414 case 7: /* unofficial extension */
3378 if (options & Opt_insecure) 3415 if (OPTION (Opt_insecure))
3379 tt_printf ("%-.250s\012", rs[Rs_display_name]); 3416 tt_printf ("%-.250s\012", rs[Rs_display_name]);
3380 break; 3417 break;
3381 case 8: /* unofficial extension */ 3418 case 8: /* unofficial extension */
3382 process_xterm_seq (XTerm_title, RESNAME "-" VERSION, CHAR_ST); 3419 process_xterm_seq (XTerm_title, RESNAME "-" VERSION, CHAR_ST);
3383 break; 3420 break;
3547 break; 3584 break;
3548 case 20: /* report icon label */ 3585 case 20: /* report icon label */
3549 { 3586 {
3550 char *s; 3587 char *s;
3551 XGetIconName (disp, parent[0], &s); 3588 XGetIconName (disp, parent[0], &s);
3552 tt_printf ("\033]L%-.250s\234", (options & Opt_insecure) && s ? s : ""); /* 8bit ST */ 3589 tt_printf ("\033]L%-.250s\234", OPTION (Opt_insecure) && s ? s : ""); /* 8bit ST */
3553 XFree (s); 3590 XFree (s);
3554 } 3591 }
3555 break; 3592 break;
3556 case 21: /* report window title */ 3593 case 21: /* report window title */
3557 { 3594 {
3558 char *s; 3595 char *s;
3559 XFetchName (disp, parent[0], &s); 3596 XFetchName (disp, parent[0], &s);
3560 tt_printf ("\033]l%-.250s\234", (options & Opt_insecure) && s ? s : ""); /* 8bit ST */ 3597 tt_printf ("\033]l%-.250s\234", OPTION (Opt_insecure) && s ? s : ""); /* 8bit ST */
3561 XFree (s); 3598 XFree (s);
3562 } 3599 }
3563 break; 3600 break;
3564 } 3601 }
3565} 3602}
3841 // TODO, when secure mode? 3878 // TODO, when secure mode?
3842 break; 3879 break;
3843 3880
3844#ifdef MENUBAR 3881#ifdef MENUBAR
3845 case URxvt_Menu: 3882 case URxvt_Menu:
3846 if (options & Opt_insecure) 3883 if (OPTION (Opt_insecure))
3847 menubar_dispatch (const_cast<char *>(str)); // casting away constness is checked 3884 menubar_dispatch (const_cast<char *>(str)); // casting away constness is checked
3848 break; 3885 break;
3849#endif 3886#endif
3850#if 0 3887#if 0
3851 case XTerm_dumpscreen: /* no error notices */ 3888 case XTerm_dumpscreen: /* no error notices */
3867 case URxvt_italicFont: 3904 case URxvt_italicFont:
3868 case URxvt_boldItalicFont: 3905 case URxvt_boldItalicFont:
3869#endif 3906#endif
3870 if (query) 3907 if (query)
3871 tt_printf ("\33]%d;%-.250s%c", saveop, 3908 tt_printf ("\33]%d;%-.250s%c", saveop,
3872 (options & Opt_insecure) && fontset[op - URxvt_font]->fontdesc 3909 OPTION (Opt_insecure) && fontset[op - URxvt_font]->fontdesc
3873 ? fontset[op - URxvt_font]->fontdesc : "", 3910 ? fontset[op - URxvt_font]->fontdesc : "",
3874 resp); 3911 resp);
3875 else 3912 else
3876 { 3913 {
3877 const char *&res = rs[Rs_font + (op - URxvt_font)]; 3914 const char *&res = rs[Rs_font + (op - URxvt_font)];
3883 break; 3920 break;
3884 3921
3885#if ENABLE_FRILLS 3922#if ENABLE_FRILLS
3886 case URxvt_locale: 3923 case URxvt_locale:
3887 if (query) 3924 if (query)
3888 tt_printf ("\33]%d;%-.250s%c", URxvt_locale, (options & Opt_insecure) ? locale : "", resp); 3925 tt_printf ("\33]%d;%-.250s%c", URxvt_locale, OPTION (Opt_insecure) ? locale : "", resp);
3889 else 3926 else
3890 { 3927 {
3891 set_locale (str); 3928 set_locale (str);
3892 pty.set_utf8_mode (enc_utf8); 3929 pty.set_utf8_mode (enc_utf8);
3893 init_xlocale (); 3930 init_xlocale ();
4021 } 4058 }
4022 4059
4023 /* extra handling for values with state unkept */ 4060 /* extra handling for values with state unkept */
4024 switch (arg[i]) 4061 switch (arg[i])
4025 { 4062 {
4063#if ENABLE_STYLES
4064 case 1021:
4065 if (mode)
4066 SET_OPTION (Opt_intensityStyles);
4067 else
4068 CLR_OPTION (Opt_intensityStyles);
4069
4070 scr_touch (true);
4071 break;
4072#endif
4026 case 1048: /* alternative cursor save */ 4073 case 1048: /* alternative cursor save */
4027 case 1049: 4074 case 1049:
4028 if (options & Opt_secondaryScreen) 4075 if (OPTION (Opt_secondaryScreen))
4029 if (mode == 0) 4076 if (mode == 0)
4030 scr_cursor (RESTORE); 4077 scr_cursor (RESTORE);
4031 else if (mode == 1) 4078 else if (mode == 1)
4032 scr_cursor (SAVE); 4079 scr_cursor (SAVE);
4033 break; 4080 break;
4048 case 3: /* 80/132 */ 4095 case 3: /* 80/132 */
4049 if (priv_modes & PrivMode_132OK) 4096 if (priv_modes & PrivMode_132OK)
4050 set_widthheight (((state ? 132 : 80) * fwidth), height); 4097 set_widthheight (((state ? 132 : 80) * fwidth), height);
4051 break; 4098 break;
4052 case 4: /* smooth scrolling */ 4099 case 4: /* smooth scrolling */
4053 if (state) 4100 if (!state)
4054 options &= ~Opt_jumpScroll; 4101 SET_OPTION (Opt_jumpScroll);
4055 else 4102 else
4056 options |= Opt_jumpScroll; 4103 CLR_OPTION (Opt_jumpScroll);
4057 break; 4104 break;
4058 case 5: /* reverse video */ 4105 case 5: /* reverse video */
4059 scr_rvideo_mode (state); 4106 scr_rvideo_mode (state);
4060 break; 4107 break;
4061 case 6: /* relative/absolute origins */ 4108 case 6: /* relative/absolute origins */
4102#if 0 4149#if 0
4103 case 1001: 4150 case 1001:
4104 break; /* X11 mouse highlighting */ 4151 break; /* X11 mouse highlighting */
4105#endif 4152#endif
4106 case 1010: /* scroll to bottom on TTY output inhibit */ 4153 case 1010: /* scroll to bottom on TTY output inhibit */
4107 if (state) 4154 if (!state)
4108 options &= ~Opt_scrollTtyOutput; 4155 SET_OPTION (Opt_scrollTtyOutput);
4109 else 4156 else
4110 options |= Opt_scrollTtyOutput; 4157 CLR_OPTION (Opt_scrollTtyOutput);
4111 break; 4158 break;
4112 case 1011: /* scroll to bottom on key press */ 4159 case 1011: /* scroll to bottom on key press */
4113 if (state) 4160 if (state)
4114 options |= Opt_scrollTtyKeypress; 4161 SET_OPTION (Opt_scrollTtyKeypress);
4115 else 4162 else
4116 options &= ~Opt_scrollTtyKeypress; 4163 CLR_OPTION (Opt_scrollTtyKeypress);
4117 break; 4164 break;
4118 case 1047: /* secondary screen w/ clearing last */ 4165 case 1047: /* secondary screen w/ clearing last */
4119 if (options & Opt_secondaryScreen) 4166 if (OPTION (Opt_secondaryScreen))
4120 if (current_screen != PRIMARY) 4167 if (current_screen != PRIMARY)
4121 scr_erase_screen (2); 4168 scr_erase_screen (2);
4122 scr_change_screen (state); 4169 scr_change_screen (state);
4123 break; 4170 break;
4124 case 1049: /* secondary screen w/ clearing first */ 4171 case 1049: /* secondary screen w/ clearing first */
4125 scr_change_screen (state); 4172 scr_change_screen (state);
4126 if (options & Opt_secondaryScreen) 4173 if (OPTION (Opt_secondaryScreen))
4127 if (current_screen != PRIMARY) 4174 if (current_screen != PRIMARY)
4128 scr_erase_screen (2); 4175 scr_erase_screen (2);
4129 break; 4176 break;
4130 default: 4177 default:
4131 break; 4178 break;
4281 case 106: 4328 case 106:
4282 case 107: 4329 case 107:
4283 scr_color ((unsigned int) (minBrightCOLOR + (arg[i] - 100)), Color_bg); 4330 scr_color ((unsigned int) (minBrightCOLOR + (arg[i] - 100)), Color_bg);
4284 break; 4331 break;
4285#endif 4332#endif
4286
4287 } 4333 }
4288 } 4334 }
4289} 4335}
4290/*}}} */ 4336/*}}} */
4291 4337
4372 } 4418 }
4373 4419
4374 memmove (v_buffer, v_buffer + written, v_buflen); 4420 memmove (v_buffer, v_buffer + written, v_buflen);
4375 } 4421 }
4376 else if (written != -1 || (errno != EAGAIN && errno != EINTR)) 4422 else if (written != -1 || (errno != EAGAIN && errno != EINTR))
4377 // original code just ignores this... 4423 pty_ev.set (EVENT_READ);
4378 destroy ();
4379} 4424}
4380 4425
4381/*----------------------- end-of-file (C source) -----------------------*/ 4426/*----------------------- end-of-file (C source) -----------------------*/
4382 4427

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines