… | |
… | |
1127 | { |
1127 | { |
1128 | // this should really be sched_yield(), but the linux guys thought |
1128 | // this should really be sched_yield(), but the linux guys thought |
1129 | // that giving a process calling sched_yield () less cpu time than |
1129 | // that giving a process calling sched_yield () less cpu time than |
1130 | // ones with high nice levels is a useful thing to do. It surely is is |
1130 | // ones with high nice levels is a useful thing to do. It surely is is |
1131 | // allowed by the sus... as is returning ENOSYS. |
1131 | // allowed by the sus... as is returning ENOSYS. |
|
|
1132 | // since the linux guys additionally thought that breaking the only |
|
|
1133 | // known workaroudn against their unusable sched_yield hack is cool, |
|
|
1134 | // we just nanosleep a bit and hope for the best. |
1132 | |
1135 | |
1133 | struct timespec ts = { 0, 0 }; |
1136 | struct timespec ts = { 0, 1000 }; |
1134 | nanosleep (&ts, 0); |
1137 | nanosleep (&ts, 0); |
1135 | |
1138 | |
1136 | w.stop (); |
1139 | w.stop (); |
1137 | } |
1140 | } |
1138 | |
1141 | |
… | |
… | |
1188 | { |
1191 | { |
1189 | make_current (); |
1192 | make_current (); |
1190 | |
1193 | |
1191 | if (revents & ev::READ) |
1194 | if (revents & ev::READ) |
1192 | // loop, but don't allow a single term to monopolize us |
1195 | // loop, but don't allow a single term to monopolize us |
1193 | while (pty_fill ()) |
1196 | for (int i = CBUFCNT; i-- && pty_fill (); ) |
1194 | if (cmd_parse ()) |
1197 | cmd_parse (); |
1195 | break; |
|
|
1196 | |
1198 | |
1197 | if (revents & ev::WRITE) |
1199 | if (revents & ev::WRITE) |
1198 | pty_write (); |
1200 | pty_write (); |
1199 | |
1201 | |
1200 | refresh_check (); |
1202 | refresh_check (); |
… | |
… | |
2182 | } |
2184 | } |
2183 | } |
2185 | } |
2184 | |
2186 | |
2185 | /*}}} */ |
2187 | /*}}} */ |
2186 | |
2188 | |
2187 | bool |
2189 | void |
2188 | rxvt_term::cmd_parse () |
2190 | rxvt_term::cmd_parse () |
2189 | { |
2191 | { |
2190 | bool flag = false; |
|
|
2191 | wchar_t ch = NOCHAR; |
2192 | wchar_t ch = NOCHAR; |
2192 | char *seq_begin; // remember start of esc-sequence here |
2193 | char *seq_begin; // remember start of esc-sequence here |
2193 | |
2194 | |
2194 | for (;;) |
2195 | for (;;) |
2195 | { |
2196 | { |
… | |
… | |
2289 | * What the heck we'll cheat and only refresh less than every page-full. |
2290 | * What the heck we'll cheat and only refresh less than every page-full. |
2290 | * if skipScroll is enabled. |
2291 | * if skipScroll is enabled. |
2291 | */ |
2292 | */ |
2292 | if (refreshnow) |
2293 | if (refreshnow) |
2293 | { |
2294 | { |
2294 | flag = true; |
|
|
2295 | scr_refresh (); |
2295 | scr_refresh (); |
2296 | want_refresh = 1; |
2296 | want_refresh = 1; |
2297 | } |
2297 | } |
2298 | |
|
|
2299 | } |
2298 | } |
2300 | else |
2299 | else |
2301 | { |
2300 | { |
2302 | try |
2301 | try |
2303 | { |
2302 | { |
… | |
… | |
2311 | } |
2310 | } |
2312 | |
2311 | |
2313 | ch = NOCHAR; |
2312 | ch = NOCHAR; |
2314 | } |
2313 | } |
2315 | } |
2314 | } |
2316 | |
|
|
2317 | return flag; |
|
|
2318 | } |
2315 | } |
2319 | |
2316 | |
2320 | // read the next character |
2317 | // read the next character |
2321 | wchar_t |
2318 | wchar_t |
2322 | rxvt_term::next_char () NOTHROW |
2319 | rxvt_term::next_char () NOTHROW |