mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-23 22:55:46 +00:00
Handle 'q' as quit if first character
This commit is contained in:
parent
9adb94a379
commit
bda07fa42b
11
Panel.c
11
Panel.c
@ -432,10 +432,21 @@ HandlerResult Panel_selectByTyping(Panel* this, int ch) {
|
||||
|
||||
if (0 < ch && ch < 255 && isalnum((unsigned char)ch)) {
|
||||
int len = strlen(buffer);
|
||||
if (!len) {
|
||||
if ('/' == ch) {
|
||||
ch = '\001';
|
||||
} else if ('q' == ch) {
|
||||
return BREAK_LOOP;
|
||||
}
|
||||
} else if (1 == len && '\001' == buffer[0]) {
|
||||
len--;
|
||||
}
|
||||
|
||||
if (len < 99) {
|
||||
buffer[len] = ch;
|
||||
buffer[len+1] = '\0';
|
||||
}
|
||||
|
||||
for (int try = 0; try < 2; try++) {
|
||||
len = strlen(buffer);
|
||||
for (int i = 0; i < size; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user