Fixed handling of command line arguments within the shell command for the VTE to enable use of shells as login shells.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1464 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
b954dc8245
commit
e0985eac5a
@ -1,3 +1,10 @@
|
||||
2007-04-19 Enrico Tröger <enrico.troeger@uvena.de>
|
||||
|
||||
* doc/geany.docbook, src/vte.c:
|
||||
Fixed handling of command line arguments within the shell command for
|
||||
the VTE to enable use of shells as login shells.
|
||||
|
||||
|
||||
2007-04-18 Nick Treleaven <nick.treleaven@btinternet.com>
|
||||
|
||||
* doc/geany.docbook:
|
||||
|
@ -394,6 +394,12 @@
|
||||
pressing the middle mouse button in the VTE (on 2-button mice,
|
||||
the middle button can often be simulated by pressing both mouse buttons together).
|
||||
</para>
|
||||
<para>
|
||||
In the preferences dialog you can specify a shell which should be started in the
|
||||
VTE. To make the specified shell a login shell just use the appropriate command
|
||||
line options for the shell. These options should be found in the manual page of
|
||||
the shell. For zsh and bash you can use the argument <literal>--login</literal>.
|
||||
</para>
|
||||
<note>
|
||||
<para><application>Geany</application> tries to load <filename>libvte.so</filename>.
|
||||
If this fails, it tries to load <filename>libvte.so.4</filename>. If this
|
||||
|
25
src/vte.c
25
src/vte.c
@ -233,8 +233,11 @@ static gboolean vte_keypress(GtkWidget *widget, GdkEventKey *event, gpointer dat
|
||||
{
|
||||
vte_get_working_directory(); // try to keep the working directory when restarting the VTE
|
||||
|
||||
kill(pid, SIGINT);
|
||||
pid = 0;
|
||||
if (pid > 0)
|
||||
{
|
||||
kill(pid, SIGINT);
|
||||
pid = 0;
|
||||
}
|
||||
vf->vte_terminal_reset(VTE_TERMINAL(widget), TRUE, TRUE);
|
||||
vte_start(widget);
|
||||
|
||||
@ -249,11 +252,21 @@ static void vte_start(GtkWidget *widget)
|
||||
{
|
||||
VteTerminal *vte = VTE_TERMINAL(widget);
|
||||
gchar **env;
|
||||
gchar **argv;
|
||||
|
||||
env = vte_get_child_environment();
|
||||
pid = vf->vte_terminal_fork_command(VTE_TERMINAL(vte), vc->shell, NULL, env,
|
||||
// split the shell command line, so arguments will work too
|
||||
argv = g_strsplit(vc->shell, " ", -1);
|
||||
|
||||
if (argv != NULL)
|
||||
{
|
||||
env = vte_get_child_environment();
|
||||
pid = vf->vte_terminal_fork_command(VTE_TERMINAL(vte), argv[0], argv, env,
|
||||
vte_info.dir, TRUE, TRUE, TRUE);
|
||||
g_strfreev(env);
|
||||
g_strfreev(env);
|
||||
g_strfreev(argv);
|
||||
}
|
||||
else
|
||||
pid = 0; // use 0 as invalid pid
|
||||
}
|
||||
|
||||
|
||||
@ -405,7 +418,7 @@ const gchar* vte_get_working_directory()
|
||||
gchar *cwd;
|
||||
gint length;
|
||||
|
||||
if (pid >= 0)
|
||||
if (pid > 0)
|
||||
{
|
||||
file = g_strdup_printf("/proc/%d/cwd", pid);
|
||||
length = readlink(file, buffer, sizeof (buffer));
|
||||
|
Loading…
x
Reference in New Issue
Block a user