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 |
1875 | 1875 | .BR No . |
1876 | 1876 | This option is disabled by default. |
1877 | 1877 | .PP |
| 1878 | .I Auto cd new terminal. |
| 1879 | If this option is enabled, mc tells its current directory to the terminal. |
| 1880 | Some graphical terminal emulators use this information to open new windows |
| 1881 | or tabs in that directory. |
| 1882 | .PP |
1878 | 1883 | .I Auto save setup. |
1879 | 1884 | If this option is enabled, when you exit Midnight Commander, the |
1880 | 1885 | configurable options of Midnight Commander are saved in the |
diff --git a/src/filemanager/boxes.c b/src/filemanager/boxes.c
index 279926690..17199414c 100644
a
|
b
|
configure_box (void) |
579 | 579 | &mc_global.widget.show_all_if_ambiguous, NULL), |
580 | 580 | QUICK_CHECKBOX (N_("Rotating d&ash"), &nice_rotating_dash, NULL), |
581 | 581 | 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 */ |
582 | 583 | QUICK_CHECKBOX (N_("Sa&fe delete"), &safe_delete, NULL), |
583 | 584 | QUICK_CHECKBOX (N_("Safe overwrite"), &safe_overwrite, NULL), /* w/o hotkey */ |
584 | 585 | QUICK_CHECKBOX (N_("A&uto save setup"), &auto_save_setup, NULL), |
585 | 586 | QUICK_SEPARATOR (FALSE), |
586 | | QUICK_SEPARATOR (FALSE), |
587 | 587 | QUICK_STOP_GROUPBOX, |
588 | 588 | QUICK_STOP_COLUMNS, |
589 | 589 | QUICK_BUTTONS_OK_CANCEL, |
diff --git a/src/filemanager/layout.c b/src/filemanager/layout.c
index 1f96c2dd1..97d88bd5e 100644
a
|
b
|
update_xterm_title_path (void) |
1581 | 1581 | void |
1582 | 1582 | update_terminal_cwd (void) |
1583 | 1583 | { |
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 ()) |
1585 | 1585 | { |
1586 | 1586 | const gchar *host; |
1587 | 1587 | char *path, *path_uri; |
diff --git a/src/setup.c b/src/setup.c
index eb729c603..3b0658448 100644
a
|
b
|
gboolean confirm_view_dir = FALSE; |
112 | 112 | /* Ask file name before start the editor */ |
113 | 113 | gboolean editor_ask_filename_before_edit = FALSE; |
114 | 114 | |
| 115 | /* Tell cwd to the terminal so it can open new tabs there */ |
| 116 | gboolean auto_cd_new_terminal = TRUE; |
| 117 | |
115 | 118 | panel_view_mode_t startup_left_mode; |
116 | 119 | panel_view_mode_t startup_right_mode; |
117 | 120 | |
… |
… |
static const struct |
366 | 369 | { "mcview_remember_file_position", &mcview_remember_file_position }, |
367 | 370 | { "auto_fill_mkdir_name", &auto_fill_mkdir_name }, |
368 | 371 | { "copymove_persistent_attr", ©move_persistent_attr }, |
| 372 | { "auto_cd_new_terminal", &auto_cd_new_terminal }, |
369 | 373 | { NULL, NULL } |
370 | 374 | }; |
371 | 375 | |
diff --git a/src/setup.h b/src/setup.h
index b6e675d75..bbee32669 100644
a
|
b
|
extern gboolean use_file_to_check_type; |
100 | 100 | #endif |
101 | 101 | extern gboolean file_op_compute_totals; |
102 | 102 | extern gboolean editor_ask_filename_before_edit; |
| 103 | extern gboolean auto_cd_new_terminal; |
103 | 104 | |
104 | 105 | extern panels_options_t panels_options; |
105 | 106 | |