[Github-comments] [geany/geany] Use lsof to get cwd of shell when /proc/pid/cwd isn't available (#436)

elextr notifications at xxxxx
Sun Apr 28 12:09:46 UTC 2019


elextr commented on this pull request.



> @@ -675,6 +682,45 @@ const gchar *vte_get_working_directory(void)
 				g_free(cwd);
 			}
 		}
+		else
+		{
+			gint status = 0;
+			gchar *stdout = NULL;
+			gchar *pid_str = g_strdup_printf("%d", pid);
+			gchar *argv[] = {"lsof", "-a", "-d", "cwd", "-F", "n", "-p", pid_str, NULL};

`utils_spawn_sync` calls `spawn_sync` which on Linux eventually calls `g_spawn_async` which specifies the array as `gchar**`, not a `const` in sight, so it may be a pain to try to `const`ize this.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/436#discussion_r279191902
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20190428/d808793f/attachment.html>


More information about the Github-comments mailing list