forked from test34/can_wizard
modify linenoiseClearScreen and linenoiseBeep
This commit is contained in:
parent
7c636e2c13
commit
943defdbaf
1 changed files with 4 additions and 5 deletions
|
@ -381,16 +381,15 @@ failed:
|
||||||
|
|
||||||
/* Clear the screen. Used to handle ctrl+l */
|
/* Clear the screen. Used to handle ctrl+l */
|
||||||
void linenoiseClearScreen(void) {
|
void linenoiseClearScreen(void) {
|
||||||
if (write(STDOUT_FILENO,"\x1b[H\x1b[2J",7) <= 0) {
|
fprintf(stdout, "\x1b[H\x1b[2J");
|
||||||
/* nothing to do, just to avoid warning. */
|
flushWrite();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Beep, used for completion when there is nothing to complete or when all
|
/* Beep, used for completion when there is nothing to complete or when all
|
||||||
* the choices were already shown. */
|
* the choices were already shown. */
|
||||||
static void linenoiseBeep(void) {
|
static void linenoiseBeep(void) {
|
||||||
fprintf(stderr, "\x7");
|
fprintf(stdout, "\x7");
|
||||||
fflush(stderr);
|
flushWrite();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ============================== Completion ================================ */
|
/* ============================== Completion ================================ */
|
||||||
|
|
Loading…
Reference in a new issue