Ticket #4594: add-auto-cd-new-terminal-conf-option.patch

File add-auto-cd-new-terminal-conf-option.patch, 3.2 KB (added by chrysos349, 11 days ago)
  • doc/man/mc.1.in

    see https://midnight-commander.org/ticket/3088
    diff --git a/doc/man/mc.1.in b/doc/man/mc.1.in
    index 96ed7cb54..17832d520 100644
    a b to 
    18751875.BR No . 
    18761876This option is disabled by default. 
    18771877.PP 
     1878.I Auto cd new terminal. 
     1879If this option is enabled, mc tells its current directory to the terminal. 
     1880Some graphical terminal emulators use this information to open new windows 
     1881or tabs in that directory. 
     1882.PP 
    18781883.I Auto save setup. 
    18791884If this option is enabled, when you exit Midnight Commander, the 
    18801885configurable options of Midnight Commander are saved in the 
  • src/filemanager/boxes.c

    diff --git a/src/filemanager/boxes.c b/src/filemanager/boxes.c
    index 279926690..17199414c 100644
    a b configure_box (void) 
    579579                                    &mc_global.widget.show_all_if_ambiguous, NULL), 
    580580                    QUICK_CHECKBOX (N_("Rotating d&ash"), &nice_rotating_dash, NULL), 
    581581                    QUICK_CHECKBOX (N_("Cd follows lin&ks"), &mc_global.vfs.cd_symlinks, NULL), 
     582                    QUICK_CHECKBOX (N_("Auto cd new terminal"), &auto_cd_new_terminal, NULL),  /* w/o hotkey */ 
    582583                    QUICK_CHECKBOX (N_("Sa&fe delete"), &safe_delete, NULL), 
    583584                    QUICK_CHECKBOX (N_("Safe overwrite"), &safe_overwrite, NULL),       /* w/o hotkey */ 
    584585                    QUICK_CHECKBOX (N_("A&uto save setup"), &auto_save_setup, NULL), 
    585586                    QUICK_SEPARATOR (FALSE), 
    586                     QUICK_SEPARATOR (FALSE), 
    587587                QUICK_STOP_GROUPBOX, 
    588588            QUICK_STOP_COLUMNS, 
    589589            QUICK_BUTTONS_OK_CANCEL, 
  • src/filemanager/layout.c

    diff --git a/src/filemanager/layout.c b/src/filemanager/layout.c
    index 1f96c2dd1..97d88bd5e 100644
    a b update_xterm_title_path (void) 
    15811581void 
    15821582update_terminal_cwd (void) 
    15831583{ 
    1584     if (mc_global.tty.xterm_flag && vfs_current_is_local ()) 
     1584    if (mc_global.tty.xterm_flag && auto_cd_new_terminal && vfs_current_is_local ()) 
    15851585    { 
    15861586        const gchar *host; 
    15871587        char *path, *path_uri; 
  • src/setup.c

    diff --git a/src/setup.c b/src/setup.c
    index eb729c603..3b0658448 100644
    a b gboolean confirm_view_dir = FALSE; 
    112112/* Ask file name before start the editor */ 
    113113gboolean editor_ask_filename_before_edit = FALSE; 
    114114 
     115/* Tell cwd to the terminal so it can open new tabs there */ 
     116gboolean auto_cd_new_terminal = TRUE; 
     117 
    115118panel_view_mode_t startup_left_mode; 
    116119panel_view_mode_t startup_right_mode; 
    117120 
    static const struct 
    366369    { "mcview_remember_file_position", &mcview_remember_file_position }, 
    367370    { "auto_fill_mkdir_name", &auto_fill_mkdir_name }, 
    368371    { "copymove_persistent_attr", &copymove_persistent_attr }, 
     372    { "auto_cd_new_terminal", &auto_cd_new_terminal }, 
    369373    { NULL, NULL } 
    370374}; 
    371375 
  • src/setup.h

    diff --git a/src/setup.h b/src/setup.h
    index b6e675d75..bbee32669 100644
    a b extern gboolean use_file_to_check_type; 
    100100#endif 
    101101extern gboolean file_op_compute_totals; 
    102102extern gboolean editor_ask_filename_before_edit; 
     103extern gboolean auto_cd_new_terminal; 
    103104 
    104105extern panels_options_t panels_options; 
    105106