From 78a6ffdd223f6575e90108b51196db7d9b4f5d39 Mon Sep 17 00:00:00 2001 From: nick black Date: Sun, 10 Jan 2021 06:17:23 -0500 Subject: [PATCH] ncdirect: call rl_deprep_terminal first --- src/lib/direct.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/direct.cpp b/src/lib/direct.cpp index 956519397..d2a5355cc 100644 --- a/src/lib/direct.cpp +++ b/src/lib/direct.cpp @@ -597,6 +597,9 @@ static int ncdirect_stop_minimal(void* vnc){ ncdirect* nc = static_cast(vnc); int ret = drop_signals(nc); + if(!(nc->flags & NCDIRECT_OPTION_NO_READLINE)){ + rl_deprep_terminal(); + } if(nc->tcache.op && term_emit("op", nc->tcache.op, nc->ttyfp, true)){ ret = -1; } @@ -615,9 +618,6 @@ ncdirect_stop_minimal(void* vnc){ } ret |= close(nc->ctermfd); } - if(!(nc->flags & NCDIRECT_OPTION_NO_READLINE)){ - rl_deprep_terminal(); - } return ret; }