29 |
#endif |
#endif |
30 |
|
|
31 |
/* The escape codes for highlighted and normal text */ |
/* The escape codes for highlighted and normal text */ |
32 |
#define HIGHLIGHT "\033[7m" |
#define HIGHLIGHT "\033[7m" |
33 |
#define NORMAL "\033[0m" |
#define NORMAL "\033[0m" |
34 |
/* The escape code to clear the screen */ |
/* The escape code to home and clear to the end of screen */ |
35 |
#define CLEAR "\033[H\033[J" |
#define CLEAR "\033[H\033[J" |
36 |
/* The escape code to clear to end of line */ |
/* The escape code to clear to the end of line */ |
37 |
#define CLEAR_2_EOL "\033[K" |
#define CLEAR_2_EOL "\033[K" |
38 |
|
|
39 |
enum { |
enum { |
430 |
* immediately */ |
* immediately */ |
431 |
eof_error = 1; |
eof_error = 1; |
432 |
} else { |
} else { |
433 |
print_statusline("read error"); |
print_statusline(bb_msg_read_error); |
434 |
} |
} |
435 |
} |
} |
436 |
#if !ENABLE_FEATURE_LESS_REGEXP |
#if !ENABLE_FEATURE_LESS_REGEXP |
542 |
cur_fline = 0; |
cur_fline = 0; |
543 |
diff = max_fline - (cur_fline + max_displayed_line) + TILDES; |
diff = max_fline - (cur_fline + max_displayed_line) + TILDES; |
544 |
/* As the number of lines requested was too large, we just move |
/* As the number of lines requested was too large, we just move |
545 |
to the end of the file */ |
* to the end of the file */ |
546 |
if (diff > 0) |
if (diff > 0) |
547 |
cur_fline += diff; |
cur_fline += diff; |
548 |
} |
} |
554 |
"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f" |
"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f" |
555 |
"\x7f\x9b"; /* DEL and infamous Meta-ESC :( */ |
"\x7f\x9b"; /* DEL and infamous Meta-ESC :( */ |
556 |
static const char ctrlconv[] ALIGN1 = |
static const char ctrlconv[] ALIGN1 = |
557 |
/* '\n': it's a former NUL - subst with '@', not 'J' */ |
/* why 40 instead of 4a below? - it is a replacement for '\n'. |
558 |
|
* '\n' is a former NUL - we subst it with @, not J */ |
559 |
"\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x40\x4b\x4c\x4d\x4e\x4f" |
"\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x40\x4b\x4c\x4d\x4e\x4f" |
560 |
"\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"; |
"\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"; |
561 |
|
|
855 |
|
|
856 |
/* We have kbd_fd in O_NONBLOCK mode, read inside read_key() |
/* We have kbd_fd in O_NONBLOCK mode, read inside read_key() |
857 |
* would not block even if there is no input available */ |
* would not block even if there is no input available */ |
858 |
rd = read_key(kbd_fd, kbd_input); |
rd = read_key(kbd_fd, kbd_input, /*timeout off:*/ -2); |
859 |
if (rd == -1) { |
if (rd == -1) { |
860 |
if (errno == EAGAIN) { |
if (errno == EAGAIN) { |
861 |
/* No keyboard input available. Since poll() did return, |
/* No keyboard input available. Since poll() did return, |