SF.net SVN: geany: [1464] trunk
eht16 at users.sourceforge.net
eht16 at xxxxx
Thu Apr 19 13:44:43 UTC 2007
Revision: 1464
http://svn.sourceforge.net/geany/?rev=1464&view=rev
Author: eht16
Date: 2007-04-19 06:44:42 -0700 (Thu, 19 Apr 2007)
Log Message:
-----------
Fixed handling of command line arguments within the shell command for the VTE to enable use of shells as login shells.
Modified Paths:
--------------
trunk/ChangeLog
trunk/doc/geany.docbook
trunk/src/vte.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2007-04-18 15:21:33 UTC (rev 1463)
+++ trunk/ChangeLog 2007-04-19 13:44:42 UTC (rev 1464)
@@ -1,3 +1,10 @@
+2007-04-19 Enrico Tröger <enrico.troeger at 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 at btinternet.com>
* doc/geany.docbook:
Modified: trunk/doc/geany.docbook
===================================================================
--- trunk/doc/geany.docbook 2007-04-18 15:21:33 UTC (rev 1463)
+++ trunk/doc/geany.docbook 2007-04-19 13:44:42 UTC (rev 1464)
@@ -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
Modified: trunk/src/vte.c
===================================================================
--- trunk/src/vte.c 2007-04-18 15:21:33 UTC (rev 1463)
+++ trunk/src/vte.c 2007-04-19 13:44:42 UTC (rev 1464)
@@ -233,8 +233,11 @@
{
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 @@
{
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 @@
gchar *cwd;
gint length;
- if (pid >= 0)
+ if (pid > 0)
{
file = g_strdup_printf("/proc/%d/cwd", pid);
length = readlink(file, buffer, sizeof (buffer));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Commits
mailing list