diff options
author | Michael Brown | 2013-12-02 18:23:09 +0100 |
---|---|---|
committer | Michael Brown | 2013-12-02 18:23:09 +0100 |
commit | 936971d0edd5fc89a77e1c4f180ec7179b495030 (patch) | |
tree | 86fbcb9572611d5fc4bbd5226eb17d6e802e3d58 /src/hci/mucurses | |
parent | [console] Allow '?' as an intermediate byte in ANSI escape sequences (diff) | |
download | ipxe-936971d0edd5fc89a77e1c4f180ec7179b495030.tar.gz ipxe-936971d0edd5fc89a77e1c4f180ec7179b495030.tar.xz ipxe-936971d0edd5fc89a77e1c4f180ec7179b495030.zip |
[mucurses] Implement curs_set() to control cursor visibility
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/hci/mucurses')
-rw-r--r-- | src/hci/mucurses/ansi_screen.c | 6 | ||||
-rw-r--r-- | src/hci/mucurses/mucurses.c | 10 | ||||
-rw-r--r-- | src/hci/mucurses/wininit.c | 1 |
3 files changed, 17 insertions, 0 deletions
diff --git a/src/hci/mucurses/ansi_screen.c b/src/hci/mucurses/ansi_screen.c index ea9ab80c..d3c685ed 100644 --- a/src/hci/mucurses/ansi_screen.c +++ b/src/hci/mucurses/ansi_screen.c @@ -86,6 +86,11 @@ static bool ansiscr_peek ( struct _curses_screen *scr __unused ) { return iskey(); } +static void ansiscr_cursor ( struct _curses_screen *scr __unused, + int visibility ) { + printf ( "\033[?25%c", ( visibility ? 'h' : 'l' ) ); +} + SCREEN _ansi_screen = { .init = ansiscr_init, .exit = ansiscr_exit, @@ -94,4 +99,5 @@ SCREEN _ansi_screen = { .putc = ansiscr_putc, .getc = ansiscr_getc, .peek = ansiscr_peek, + .cursor = ansiscr_cursor, }; diff --git a/src/hci/mucurses/mucurses.c b/src/hci/mucurses/mucurses.c index ab9a6535..c368b763 100644 --- a/src/hci/mucurses/mucurses.c +++ b/src/hci/mucurses/mucurses.c @@ -144,3 +144,13 @@ int wmove ( WINDOW *win, int y, int x ) { _wupdcurs(win); return OK; } + +/** + * Set cursor visibility + * + * @v visibility cursor visibility + */ +int curs_set ( int visibility ) { + stdscr->scr->cursor ( stdscr->scr, visibility ); + return OK; +} diff --git a/src/hci/mucurses/wininit.c b/src/hci/mucurses/wininit.c index 782e7b5c..b75abba4 100644 --- a/src/hci/mucurses/wininit.c +++ b/src/hci/mucurses/wininit.c @@ -31,6 +31,7 @@ WINDOW *initscr ( void ) { int endwin ( void ) { attrset ( 0 ); color_set ( 0, NULL ); + curs_set ( 1 ); mvprintw ( ( LINES - 1 ), 0, "\n" ); stdscr->scr->exit( stdscr->scr ); return OK; |