Skip to content

Commit

Permalink
Setup VTE stash group in init_pref_groups() (PR #3156)
Browse files Browse the repository at this point in the history
Like with all other stash groups, the VTE one is now set up in
init_pref_groups(), along with the terminal various pref group.

Since be739e2 ("session.conf split follow-up #3"), the send_cmd_prefix
pref was read from the configuration before setting up the stash group,
which caused the "Follow path of the current file" feature to crash
Geany. I.e. the fix is to set up the stash group even earlier.

In my optionion, it's also beneficial that the overall stash groups
do not depend on loading libvte or not. For example, previously the
terminal various pref group was only added when loading libvte was not
disabled. When it was disabled the end result was inconsistent with
the manual. Now the terminal group appears unconditionally.

Fixes be739e2 ("session.conf split follow-up #3")
Fixes #3151
  • Loading branch information
kugel- committed Apr 11, 2022
1 parent 1364b1c commit df27d1b
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/keyfile.c
Expand Up @@ -299,6 +299,17 @@ static void init_pref_groups(void)
"socket_remote_cmd_port", SOCKET_WINDOWS_REMOTE_CMD_PORT);
#endif

#ifdef HAVE_VTE
/* various VTE prefs. */
group = stash_group_new("VTE");
configuration_add_various_pref_group(group, "terminal");

stash_group_add_string(group, &vte_config.send_cmd_prefix,
"send_cmd_prefix", "");
stash_group_add_boolean(group, &vte_config.send_selection_unsafe,
"send_selection_unsafe", FALSE);
#endif

/* Note: Interface-related various prefs are in ui_init_prefs() */

/* various build-menu prefs */
Expand Down Expand Up @@ -911,7 +922,6 @@ static void load_dialog_prefs(GKeyFile *config)
if (vte_info.load_vte && vte_info.load_vte_cmdline /* not disabled on the cmdline */)
{
VteConfig *vc = &vte_config;
StashGroup *group;
struct passwd *pw = getpwuid(getuid());
const gchar *shell = (pw != NULL) ? pw->pw_shell : "/bin/sh";

Expand Down Expand Up @@ -943,15 +953,6 @@ static void load_dialog_prefs(GKeyFile *config)
vc->scrollback_lines = utils_get_setting_integer(config, "VTE", "scrollback_lines", 500);
get_setting_color(config, "VTE", "colour_fore", &vc->colour_fore, "#ffffff");
get_setting_color(config, "VTE", "colour_back", &vc->colour_back, "#000000");

/* various VTE prefs.
* this can't be done in init_pref_groups() because we need to know the value of
* vte_info.load_vte, and `vc` to be initialized */
group = stash_group_new("VTE");
configuration_add_various_pref_group(group, "terminal");

stash_group_add_string(group, &vc->send_cmd_prefix, "send_cmd_prefix", "");
stash_group_add_boolean(group, &vc->send_selection_unsafe, "send_selection_unsafe", FALSE);
}
#endif
/* templates */
Expand Down

0 comments on commit df27d1b

Please sign in to comment.