Add a configurable prefix for commands sent to the shell in the VTE
This adds an hidden VTE preference, send_cmd_prefix, that allows to define a prefix for the commands Geany sends to the shell in the VTE like "cd" when following current path. This can be used for example to prevent some shells (Bash, ZSH, maybe others) from putting these commands in the history by setting this to a space.
This commit is contained in:
parent
5b41e177de
commit
59eb0557b6
@ -3,7 +3,7 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.9: http://docutils.sourceforge.net/" />
|
||||
<meta name="generator" content="Docutils 0.8.1: http://docutils.sourceforge.net/" />
|
||||
<title>Geany</title>
|
||||
<meta name="authors" content="Enrico Tröger Nick Treleaven Frank Lanitz Colomban Wendling" />
|
||||
<meta name="date" content="2011-10-02" />
|
||||
@ -2915,6 +2915,19 @@ to true.</td>
|
||||
<td>false</td>
|
||||
<td>immediately</td>
|
||||
</tr>
|
||||
<tr><td>send_cmd_prefix</td>
|
||||
<td>String with which prefix the commands sent
|
||||
to the shell. This may be used to tell
|
||||
some shells (BASH with <tt class="docutils literal">HISTCONTROL</tt> set
|
||||
to <tt class="docutils literal">ignorespace</tt>, ZSH with
|
||||
<tt class="docutils literal">HIST_IGNORE_SPACE</tt> enabled, etc.) from
|
||||
putting these commands in their history by
|
||||
setting this to a space. Note that leading
|
||||
spaces must be escaped using <cite>s</cite> in the
|
||||
configuration file.</td>
|
||||
<td>Empty</td>
|
||||
<td>immediately</td>
|
||||
</tr>
|
||||
<tr><td><strong>File related</strong></td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
@ -6710,7 +6723,7 @@ USE OR PERFORMANCE OF THIS SOFTWARE.</p>
|
||||
<div class="footer">
|
||||
<hr class="footer" />
|
||||
<a class="reference external" href="geany.txt">View document source</a>.
|
||||
Generated on: 2011-11-16 17:24 UTC.
|
||||
Generated on: 2011-11-17 02:56 UTC.
|
||||
Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
|
||||
|
||||
</div>
|
||||
|
@ -2512,6 +2512,15 @@ send_selection_unsafe By default, Geany strips any trailing f
|
||||
If, for whatever reasons, you really want
|
||||
it to be executed directly, set this option
|
||||
to true.
|
||||
send_cmd_prefix String with which prefix the commands sent Empty immediately
|
||||
to the shell. This may be used to tell
|
||||
some shells (BASH with ``HISTCONTROL`` set
|
||||
to ``ignorespace``, ZSH with
|
||||
``HIST_IGNORE_SPACE`` enabled, etc.) from
|
||||
putting these commands in their history by
|
||||
setting this to a space. Note that leading
|
||||
spaces must be escaped using `\s` in the
|
||||
configuration file.
|
||||
**File related**
|
||||
use_atomic_file_saving Defines the mode how Geany saves files to false immediately
|
||||
disk. If disabled, Geany directly writes
|
||||
|
@ -496,6 +496,8 @@ static void save_dialog_prefs(GKeyFile *config)
|
||||
if (!g_key_file_has_key(config, "VTE", "send_selection_unsafe", NULL)) /* hidden */
|
||||
g_key_file_set_boolean(config, "VTE", "send_selection_unsafe",
|
||||
vc->send_selection_unsafe);
|
||||
if (!g_key_file_has_key(config, "VTE", "send_cmd_prefix", NULL)) /* hidden */
|
||||
g_key_file_set_string(config, "VTE", "send_cmd_prefix", vc->send_cmd_prefix);
|
||||
g_key_file_set_string(config, "VTE", "font", vc->font);
|
||||
g_key_file_set_boolean(config, "VTE", "scroll_on_key", vc->scroll_on_key);
|
||||
g_key_file_set_boolean(config, "VTE", "scroll_on_out", vc->scroll_on_out);
|
||||
@ -826,6 +828,7 @@ static void load_dialog_prefs(GKeyFile *config)
|
||||
vc->enable_bash_keys = utils_get_setting_boolean(config, "VTE", "enable_bash_keys", TRUE);
|
||||
vc->ignore_menu_bar_accel = utils_get_setting_boolean(config, "VTE", "ignore_menu_bar_accel", FALSE);
|
||||
vc->follow_path = utils_get_setting_boolean(config, "VTE", "follow_path", FALSE);
|
||||
vc->send_cmd_prefix = utils_get_setting_string(config, "VTE", "send_cmd_prefix", "");
|
||||
vc->run_in_vte = utils_get_setting_boolean(config, "VTE", "run_in_vte", FALSE);
|
||||
vc->skip_run_script = utils_get_setting_boolean(config, "VTE", "skip_run_script", FALSE);
|
||||
vc->cursor_blinks = utils_get_setting_boolean(config, "VTE", "cursor_blinks", FALSE);
|
||||
|
@ -298,6 +298,7 @@ void vte_close(void)
|
||||
g_free(vc->font);
|
||||
g_free(vc->colour_back);
|
||||
g_free(vc->colour_fore);
|
||||
g_free(vc->send_cmd_prefix);
|
||||
g_free(vc);
|
||||
g_free(gtk_menu_key_accel);
|
||||
/* Don't unload the module explicitly because it causes a segfault on FreeBSD. The segfault
|
||||
@ -660,7 +661,7 @@ void vte_cwd(const gchar *filename, gboolean force)
|
||||
{
|
||||
/* use g_shell_quote to avoid problems with spaces, '!' or something else in path */
|
||||
gchar *quoted_path = g_shell_quote(path);
|
||||
gchar *cmd = g_strconcat("cd ", quoted_path, "\n", NULL);
|
||||
gchar *cmd = g_strconcat(vc->send_cmd_prefix, "cd ", quoted_path, "\n", NULL);
|
||||
if (! vte_send_cmd(cmd))
|
||||
{
|
||||
ui_set_statusbar(FALSE,
|
||||
|
Loading…
x
Reference in New Issue
Block a user