aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/terminal.vala
diff options
context:
space:
mode:
authorJuhani Krekelä2025-02-12 18:06:20 +0200
committerWolfgang Müller2025-02-12 17:19:22 +0100
commitd6090f7488b43346bcdd354d15363e3620375f43 (patch)
tree9e7ffdc1d210d08f866e0198d626947e8c1f6818 /terminal.vala
parent623985d13002e99e2780655016281f790a25473c (diff)
downloadweltschmerz-d6090f7488b43346bcdd354d15363e3620375f43.tar.gz
Also look for a compatible procfs in /compat/linux/proc
On FreeBSD it is conventional to mount the Linux-style proc filesystem at /compat/linux/proc, if it is required by installed software. Falling back to it, if we can't determine the current working directory using /proc, makes weltschmerz work better out of the box on FreeBSD without regressing Linux.
Diffstat (limited to '')
-rw-r--r--terminal.vala6
1 files changed, 5 insertions, 1 deletions
diff --git a/terminal.vala b/terminal.vala
index fcb456c..6dfe61e 100644
--- a/terminal.vala
+++ b/terminal.vala
@@ -419,7 +419,11 @@ class Terminal : Gtk.Overlay {
return osc7_path;
}
- return Posix.realpath("/proc/%i/cwd".printf(child_pid));
+ string? path = Posix.realpath("/proc/%i/cwd".printf(child_pid));
+ // If we couldn't get the cwd from /proc, try /compat/linux/proc
+ if (path == null)
+ path = Posix.realpath("/compat/linux/proc/%i/cwd".printf(child_pid));
+ return path;
}
void spawn_process(string? cwd, string[] argv) {