diff options
| author | Jörg Bakker <captaingroove@openmultimedia.org> | 2023-06-16 11:59:25 +0200 |
|---|---|---|
| committer | Randy Palamar <palamar@ualberta.ca> | 2023-07-18 21:06:46 -0600 |
| commit | 80fbb7e1ead4d16f1f4d511d30df18eeb65ceafa (patch) | |
| tree | 106950ed5bdcfbc14b18c6bc8e96df92aa951268 /ui-terminal-curses.c | |
| parent | 599ced0bfc378682053484a9658bd59c02c96973 (diff) | |
| download | vis-80fbb7e1ead4d16f1f4d511d30df18eeb65ceafa.tar.gz vis-80fbb7e1ead4d16f1f4d511d30df18eeb65ceafa.tar.xz | |
Add fullscreen param to vis_pipe_collect() and Lua API vis:pipe()
This enables restoring the terminal from a fullscreen command like
curses based program. Use cases are e.g. a file picker based on some
external program like nnn (https://github.com/jarun/nnn).
Diffstat (limited to 'ui-terminal-curses.c')
| -rw-r--r-- | ui-terminal-curses.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ui-terminal-curses.c b/ui-terminal-curses.c index e5ab853..93f729e 100644 --- a/ui-terminal-curses.c +++ b/ui-terminal-curses.c @@ -242,9 +242,14 @@ static bool ui_curses_resize(UiTerm *tui, int width, int height) { wresize(stdscr, height, width) == OK; } -static void ui_curses_save(UiTerm *tui) { +static void ui_curses_save(UiTerm *tui, bool fscr) { curs_set(1); - reset_shell_mode(); + if (fscr) { + def_prog_mode(); + endwin(); + } else { + reset_shell_mode(); + } } static void ui_curses_restore(UiTerm *tui) { |
