From 71388f94c694a36b0ac360b34f09d7c16a51f803 Mon Sep 17 00:00:00 2001 From: Juhani Krekelä Date: Sat, 23 Oct 2021 00:33:17 +0300 Subject: Add procfs fallback for figuring out the cwd Opening a terminal or file manager window requires weltschmerz to know the current working directory. At the moment weltschmerz relies on the application being run in the terminal to generate OSC 7 codes that specify the path. However, OSC 7 is not yet widely supported by default, and the VTE terminal emulation layer, which manages the OSC 7 path state for weltschmerz, will overwrite local paths with ones that point to a remote computer if an OSC 7 enabled application is run under ssh. This change adds a fallback that uses the symlink to current working directory located at /proc//cwd. On Linux this method should always work and was how these features were implemented before adoption of OSC 7. The procfs method is used as a fallback instead of the primary method since it can only see the working directory changes of the direct child process. --- weltschmerz.1 | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'weltschmerz.1') diff --git a/weltschmerz.1 b/weltschmerz.1 index 6b64184..2e0a2fb 100644 --- a/weltschmerz.1 +++ b/weltschmerz.1 @@ -45,19 +45,15 @@ and It can be reset to its default value with .Sy CTRL + 0 . .Pp -The program's current directory can be opened in the default file manager with -.Sy CTRL + Shift + O . -Note that -.Nm -relies on proper support of OSC 7 to do this. -If the child program (such as the shell or an editor) does not send OSC 7, -this feature will not work. -.Pp -A new terminal window can likewise be opened in the program's current directory with -.Sy CTRL + Shift + T . -The limitations of +The default file manager can be opened in the current directory with .Sy CTRL + Shift + O -also apply here. +and a new terminal window with +.Sy CTRL + Shift + T . +By default OSC 7 path is used as the current directory, but if OSC 7 path is not +set to a valid local path and the platform provides a Linux-style procfs at +.Pa /proc , +.Nm +will use the child process's working directory instead. .Sh SEARCH OVERLAY The search overlay can be opened by pressing .Sy CTRL + Shift + F . -- cgit v1.2.3-2-gb3c3