aboutsummaryrefslogtreecommitdiffstats
path: root/com32/hdt
diff options
context:
space:
mode:
Diffstat (limited to 'com32/hdt')
-rw-r--r--com32/hdt/hdt-cli.c9
-rw-r--r--com32/hdt/lib-ansi.c7
-rw-r--r--com32/hdt/lib-ansi.h1
3 files changed, 16 insertions, 1 deletions
diff --git a/com32/hdt/hdt-cli.c b/com32/hdt/hdt-cli.c
index 7e8954c8..c8d9ce8b 100644
--- a/com32/hdt/hdt-cli.c
+++ b/com32/hdt/hdt-cli.c
@@ -776,9 +776,16 @@ void start_cli_mode(struct s_hardware *hardware)
while (hdt_cli.mode != EXIT_MODE) {
- //fgets(cli_line, sizeof cli_line, stdin);
+ /* Let's put the cursor blinking until we get an input */
+ set_cursor_blink(true);
+
+ /* We wait endlessly for a keyboard input*/
current_key = get_key(stdin, 0);
+ /* We have to cancel the blinking mode to prevent
+ * input text to blink */
+ set_cursor_blink(false);
+
/* Reset autocomplete buffer unless TAB is pressed */
if (current_key != KEY_TAB)
autocomplete_destroy_list();
diff --git a/com32/hdt/lib-ansi.c b/com32/hdt/lib-ansi.c
index 12e5ecc7..411dba80 100644
--- a/com32/hdt/lib-ansi.c
+++ b/com32/hdt/lib-ansi.c
@@ -61,6 +61,13 @@ void move_cursor_right(int count) {
fputs(buffer, stdout);
}
+void set_cursor_blink(bool status) {
+ if (status == true)
+ fputs("\033[05m",stdout);
+ else
+ fputs("\033[0m",stdout);
+}
+
void clear_line() {
fputs("\033[2K", stdout);
}
diff --git a/com32/hdt/lib-ansi.h b/com32/hdt/lib-ansi.h
index 2a17766f..0b0d0d18 100644
--- a/com32/hdt/lib-ansi.h
+++ b/com32/hdt/lib-ansi.h
@@ -40,4 +40,5 @@ void disable_utf8();
void set_g1_special_char();
void set_us_g0_charset();
void clear_entire_screen();
+void set_cursor_blink(bool status);
#endif