1 --- a/src/profile-editor.c
2 +++ a/src/profile-editor.c
3 @@ -755,6 +755,29 @@ bool_to_scrollbar_policy (const GValue *value,
4 return g_variant_new_string (g_value_get_boolean (value) ? "always" : "never");
8 +maybestring_to_string (GValue *value,
12 + const char *default_value = (const char *) user_data;
13 + gs_free const char *str;
15 + g_variant_get (variant, "ms", &str);
16 + g_value_set_string (value, str != NULL ? str : default_value);
22 +string_to_maybestring (const GValue *value,
23 + const GVariantType *expected_type,
26 + return g_variant_new_maybe(G_VARIANT_TYPE_STRING,
27 + g_variant_new_string (g_value_get_string (value)));
31 * terminal_profile_edit:
32 * @profile: a #GSettings
33 @@ -1060,6 +1083,16 @@ terminal_profile_edit (GSettings *profile,
34 gtk_builder_get_object (builder,
35 "use-theme-colors-checkbutton"),
36 "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
37 + g_settings_bind_with_mapping (profile,
38 + TERMINAL_PROFILE_WORD_CHAR_EXCEPTIONS_KEY,
39 + gtk_builder_get_object (builder,
40 + "word-char-exceptions-entry"),
42 + G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET,
43 + (GSettingsBindGetMapping) maybestring_to_string,
44 + (GSettingsBindSetMapping) string_to_maybestring,
45 + (gpointer) g_strdup (GNOME_TERMINAL_WORD_CHAR_EXCEPTIONS_DEFAULT), /* work around const-ness issue */
47 g_settings_bind (profile, TERMINAL_PROFILE_AUDIBLE_BELL_KEY,
48 gtk_builder_get_object (builder, "bell-checkbutton"),
50 --- a/src/profile-preferences.ui
51 +++ a/src/profile-preferences.ui
56 + <object class="GtkLabel" id="word-char-exceptions-entry-label">
57 + <property name="visible">True</property>
58 + <property name="can_focus">False</property>
59 + <property name="xalign">0</property>
60 + <property name="label" translatable="yes">_Word characters:</property>
61 + <property name="use_underline">True</property>
62 + <property name="justify">center</property>
63 + <property name="mnemonic_widget">word-char-exceptions-entry</property>
66 + <property name="left_attach">0</property>
67 + <property name="right_attach">1</property>
68 + <property name="top_attach">4</property>
69 + <property name="bottom_attach">5</property>
73 + <object class="GtkEntry" id="word-char-exceptions-entry">
74 + <property name="visible">True</property>
75 + <property name="can_focus">True</property>
78 + <property name="left_attach">1</property>
79 + <property name="right_attach">4</property>
80 + <property name="top_attach">4</property>
81 + <property name="bottom_attach">5</property>
85 <object class="GtkCheckButton" id="bell-checkbutton">
86 <property name="label" translatable="yes">Terminal _bell</property>
87 <property name="visible">True</property>
90 <property name="left_attach">0</property>
91 <property name="right_attach">4</property>
92 - <property name="top_attach">4</property>
93 - <property name="bottom_attach">5</property>
94 + <property name="top_attach">5</property>
95 + <property name="bottom_attach">6</property>
101 <property name="left_attach">0</property>
102 <property name="right_attach">1</property>
103 - <property name="top_attach">5</property>
104 - <property name="bottom_attach">6</property>
105 + <property name="top_attach">6</property>
106 + <property name="bottom_attach">7</property>
112 <property name="left_attach">0</property>
113 <property name="right_attach">1</property>
114 - <property name="top_attach">6</property>
115 - <property name="bottom_attach">7</property>
116 + <property name="top_attach">7</property>
117 + <property name="bottom_attach">8</property>
123 <property name="left_attach">0</property>
124 <property name="right_attach">1</property>
125 - <property name="top_attach">7</property>
126 - <property name="bottom_attach">8</property>
127 + <property name="top_attach">8</property>
128 + <property name="bottom_attach">9</property>
134 <property name="left_attach">0</property>
135 <property name="right_attach">1</property>
136 - <property name="top_attach">8</property>
137 - <property name="bottom_attach">9</property>
138 + <property name="top_attach">9</property>
139 + <property name="bottom_attach">10</property>
145 <property name="left_attach">1</property>
146 <property name="right_attach">4</property>
147 - <property name="top_attach">8</property>
148 - <property name="bottom_attach">9</property>
149 + <property name="top_attach">9</property>
150 + <property name="bottom_attach">10</property>
154 --- a/src/terminal-app.h
155 +++ a/src/terminal-app.h
156 @@ -33,6 +33,20 @@ G_BEGIN_DECLS
158 #define MONOSPACE_FONT_KEY_NAME "monospace-font-name"
160 +/* Vte allows to set either a string, or NULL. In the latter case (which is
161 + * its default on startup) it uses a built-in set. This is a reasonable
162 + * behavior for all the apps out there that don't wish to bother with this
163 + * setting. However, there's no way to query what that string is (the getter
164 + * API call returns NULL) and we can't safely assume that it won't change over
165 + * time. So for a graphical frontend that wants to expose this option to the
166 + * user, either the UI becomes too complicated and user-unfriendly (with a
167 + * checkbox whether to use the default, which is then not shown), or it
168 + * forgets about vte's default and always set a non-NULL value. Go for the
169 + * latter approach of course, yet copy vte-0.40's default to be our default
172 +#define GNOME_TERMINAL_WORD_CHAR_EXCEPTIONS_DEFAULT "-#%&+,./=?@\\_~\302\267"
176 #define TERMINAL_TYPE_APP (terminal_app_get_type ())
177 --- a/src/terminal-screen.c
178 +++ a/src/terminal-screen.c
179 @@ -801,6 +801,8 @@ terminal_screen_profile_changed_cb (GSettings *profile,
181 gs_free char *word_char_exceptions;
182 g_settings_get (profile, TERMINAL_PROFILE_WORD_CHAR_EXCEPTIONS_KEY, "ms", &word_char_exceptions);
183 + if (word_char_exceptions == NULL)
184 + word_char_exceptions = g_strdup (GNOME_TERMINAL_WORD_CHAR_EXCEPTIONS_DEFAULT);
185 vte_terminal_set_word_char_exceptions (vte_terminal, word_char_exceptions);