Ticket #4171: 0001-Fix-silent-macro-runs-make-the-terminal-undisrupted.2.patch

File 0001-Fix-silent-macro-runs-make-the-terminal-undisrupted.2.patch, 1.3 KB (added by psprint, 13 months ago)
  • src/editor/editcmd.c

    From d2d753a78887f690290f2572c218ce543fe5b40d Mon Sep 17 00:00:00 2001
    From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
    Date: Mon, 11 Jan 2021 07:53:07 -0600
    Subject: [PATCH] =?UTF-8?q?Fix=20#silent=20macro=20runs=20=E2=80=94=20make?=
     =?UTF-8?q?=20the=20terminal=20undisrupted.?=
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    
    ---
     src/editor/editcmd.c | 8 ++++++++
     1 file changed, 8 insertions(+)
    
    diff --git a/src/editor/editcmd.c b/src/editor/editcmd.c
    index e2b904604..95f5b2474 100644
    a b edit_block_process_cmd (WEdit * edit, int macro_number) 
    32713271    char *fname; 
    32723272    char *macros_fname = NULL; 
    32733273 
     3274    /* Prepare the terminal by setting its flag to the initial ones. This will cause \r to work as 
     3275     * expected, instead of being ignored. */ 
     3276    tty_reset_shell_mode(); 
     3277 
    32743278    fname = g_strdup_printf ("%s.%i.sh", EDIT_HOME_MACRO_FILE, macro_number); 
    32753279    macros_fname = g_build_filename (mc_config_get_data_path (), fname, (char *) NULL); 
    32763280    user_menu (edit, macros_fname, 0); 
    32773281    g_free (fname); 
    32783282    g_free (macros_fname); 
     3283 
     3284    /* Restore the SLang terminal configuration and redraw the editor. */ 
     3285    tty_raw_mode(); 
     3286    edit_refresh_cmd(); 
    32793287    edit->force |= REDRAW_COMPLETELY; 
    32803288} 
    32813289