1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-30 19:42:05 +03:00

regedit: add a panic handler to restore terminal

Signed-off-by: Chris Davis <cd.rattan@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
This commit is contained in:
Chris Davis
2014-07-01 16:00:16 -07:00
committed by Michael Adam
parent f9a2f2eb7c
commit fec275a4a8

View File

@ -567,6 +567,12 @@ int regedit_getch(void)
return c;
}
static void regedit_panic_handler(const char *msg)
{
endwin();
smb_panic_s3(msg);
}
static void display_window(TALLOC_CTX *mem_ctx, struct registry_context *ctx)
{
struct regedit *regedit;
@ -579,6 +585,8 @@ static void display_window(TALLOC_CTX *mem_ctx, struct registry_context *ctx)
cbreak();
noecho();
fault_configure(regedit_panic_handler);
colors = has_colors();
if (colors) {
start_color();