abduco

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | LICENSE

commit f7b65db3caa3c668d03fc6a970d4f5b24ce372d8
parent 4d80fccaa4348730bb86ac68ffd37102ef350837
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Thu,  7 Jan 2016 13:26:02 +0100

Make cursor visible after client termination

For complex interactive application it is recommended to run them
under dvtm as in:

 $ abduco -c demo dvtm [your-fancy-app]

Diffstat:
client.c | 6+++---
testsuite.sh | 2+-
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/client.c b/client.c @@ -23,9 +23,9 @@ static bool client_recv_packet(Packet *pkt) { static void client_restore_terminal(void) { if (has_term) - tcsetattr(STDIN_FILENO, TCSADRAIN, &orig_term); + tcsetattr(STDIN_FILENO, TCSAFLUSH, &orig_term); if (alternate_buffer) { - printf("\033[?1049l"); + printf("\033[?25h\033[?1049l"); fflush(stdout); alternate_buffer = false; } @@ -43,7 +43,7 @@ static void client_setup_terminal(void) { cur_term.c_cc[VLNEXT] = _POSIX_VDISABLE; cur_term.c_cc[VMIN] = 1; cur_term.c_cc[VTIME] = 0; - tcsetattr(STDIN_FILENO, TCSADRAIN, &cur_term); + tcsetattr(STDIN_FILENO, TCSANOW, &cur_term); if (!alternate_buffer) { printf("\033[?1049h\033[H"); diff --git a/testsuite.sh b/testsuite.sh @@ -36,7 +36,7 @@ expected_abduco_prolog() { # $1 => session-name, $2 => exit status expected_abduco_epilog() { - echo "[?1049labduco: $1: session terminated with exit status $2" + echo "[?25h[?1049labduco: $1: session terminated with exit status $2" } # $1 => session-name, $2 => cmd to run