From d6090f7488b43346bcdd354d15363e3620375f43 Mon Sep 17 00:00:00 2001 From: Juhani Krekelä Date: Wed, 12 Feb 2025 18:06:20 +0200 Subject: 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. --- terminal.vala | 6 +++++- weltschmerz.1 | 6 ++++-- weltschmerz.de.1 | 4 +++- weltschmerz.fi.1 | 4 +++- 4 files changed, 15 insertions(+), 5 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) { diff --git a/weltschmerz.1 b/weltschmerz.1 index 587d342..3622791 100644 --- a/weltschmerz.1 +++ b/weltschmerz.1 @@ -1,4 +1,4 @@ -.Dd October 23, 2021 +.Dd February 12, 2025 .Dt WELTSCHMERZ 1 .Os .Sh NAME @@ -51,7 +51,9 @@ and a new terminal window with .Sy CTRL + Shift + T . These features require the terminal application to send OSC 7 escape sequences or for the platform to provide a Linux-style procfs at -.Pa /proc . +.Pa /proc +or +.Pa /compat/linux/proc . .Sh SEARCH OVERLAY The search overlay can be opened by pressing .Sy CTRL + Shift + F . diff --git a/weltschmerz.de.1 b/weltschmerz.de.1 index b0b3a08..a9f67cc 100644 --- a/weltschmerz.de.1 +++ b/weltschmerz.de.1 @@ -1,4 +1,4 @@ -.Dd 27. Oktober 2021 +.Dd 12. Februar 2025 .Dt WELTSCHMERZ 1 .Os .Sh BEZEICHNUNG @@ -57,6 +57,8 @@ Diese Funktionen sind nur vorhanden, wenn das zugrunde liegende Programm (etwa der Editor oder die Shell) die OSC 7 Escape-Sequenz unterstützt oder das Betriebssystem ein Linux-artiges procfs auf .Pa /proc +oder +.Pa /compat/linux/proc bereitstellt. .Sh SUCHFELD Das Suchfeld lässt sich mit diff --git a/weltschmerz.fi.1 b/weltschmerz.fi.1 index 804dd16..17ad8b7 100644 --- a/weltschmerz.fi.1 +++ b/weltschmerz.fi.1 @@ -1,4 +1,4 @@ -.Dd 23. lokakuuta 2021 +.Dd 12. helmikuuta 2025 .Dt WELTSCHMERZ 1 .Os .Sh NIMI @@ -53,6 +53,8 @@ ja uuden pääteikkunan yhdistelmällä Nämä ominaisuudet vaativat joko pääteessä ajettavan ohjelman lähettävän OSC 7 -ohjauskoodeja tai ajoympäristön tarjoavan Linux-tyylisen procfs:n polun .Pa /proc +tai +.Pa /compat/linux/proc alla. .Sh HAKUPÄÄLLYSIKKUNA Hakupäällysikkunan voi avata näppäinyhdistelmällä -- cgit v1.2.3-2-gb3c3