aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--config.vala2
-rw-r--r--terminal.vala9
-rw-r--r--weltschmerz.124
3 files changed, 27 insertions, 8 deletions
diff --git a/config.vala b/config.vala
index c0a084f..d972bac 100644
--- a/config.vala
+++ b/config.vala
@@ -12,6 +12,7 @@ class Config {
public int scrollback;
public bool scrollbar;
public bool allow_hyperlinks;
+ public bool prefer_osc7;
public Gdk.RGBA? foreground;
public Gdk.RGBA? background;
@@ -57,6 +58,7 @@ class Config {
scrollback = reader.read_integer("misc", "scrollback", 10000);
scrollbar = reader.read_boolean("misc", "scrollbar", true);
allow_hyperlinks = reader.read_boolean("misc", "allow-hyperlinks", false);
+ prefer_osc7 = reader.read_boolean("misc", "prefer-osc7", true);
foreground = reader.read_colour("colours", "foreground", null);
background = reader.read_colour("colours", "background", null);
diff --git a/terminal.vala b/terminal.vala
index bb66715..da013a5 100644
--- a/terminal.vala
+++ b/terminal.vala
@@ -396,9 +396,12 @@ class Terminal : Gtk.Overlay {
}
string? get_cwd() {
- string? osc7_path = get_osc7_path();
- if (osc7_path != null)
- return osc7_path;
+ if (conf.prefer_osc7) {
+ string? osc7_path = get_osc7_path();
+ if (osc7_path != null)
+ return osc7_path;
+ }
+
return Posix.realpath("/proc/%i/cwd".printf(child_pid));
}
diff --git a/weltschmerz.1 b/weltschmerz.1
index 2e0a2fb..aaad053 100644
--- a/weltschmerz.1
+++ b/weltschmerz.1
@@ -49,11 +49,9 @@ The default file manager can be opened in the current directory with
.Sy CTRL + Shift + O
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.
+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 .
.Sh SEARCH OVERLAY
The search overlay can be opened by pressing
.Sy CTRL + Shift + F .
@@ -161,6 +159,22 @@ Specifies how many lines of scrollback to keep.
A value of -1 means infinite scrollback.
The default is
.Sy 10000 .
+.It Sy prefer-osc7
+When set to
+.Sy true ,
+.Nm
+attempts to use OSC 7 to obtain the current directory.
+If this does not produce a valid local path,
+.Nm
+obtains the child process's working directory from
+.Pa /proc .
+When set to
+.Sy false ,
+only
+.Pa /proc
+is used.
+The default is
+.Sy true .
.It Sy scrollbar
When set to
.Sy true ,