summaryrefslogtreecommitdiff
path: root/editors/elementary-code/files/patch-src_Widgets_Terminal.vala
blob: 7125d4fc56347808ac0adc07e704855adb108357 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--- src/Widgets/Terminal.vala.orig	2023-08-01 20:46:55 UTC
+++ src/Widgets/Terminal.vala
@@ -87,13 +87,14 @@ public class Code.Terminal : Gtk.Box {
     }
 
     private string get_shell_location () {
-        int pid = (!) (this.child_pid);
+        string cwd = "";
         try {
-            return GLib.FileUtils.read_link ("/proc/%d/cwd".printf (pid));
-        } catch (GLib.FileError error) {
+            GLib.Process.spawn_command_line_sync ("pwd", out cwd);
+        } catch (GLib.SpawnError error) {
             warning ("An error occurred while fetching the current dir of shell: %s", error.message);
-            return "";
         }
+
+        return cwd;
     }
 
     private void update_terminal_settings (string settings_schema) {