Files

22 lines
752 B
Vala
Raw Permalink Normal View History

2023-08-07 08:35:31 +02:00
--- src/Widgets/Terminal.vala.orig 2023-08-01 20:46:55 UTC
2023-01-25 07:55:18 +01:00
+++ 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));
2023-08-07 08:35:31 +02:00
- } catch (GLib.FileError error) {
2023-01-25 07:55:18 +01:00
+ GLib.Process.spawn_command_line_sync ("pwd", out cwd);
2023-08-07 08:35:31 +02:00
+ } catch (GLib.SpawnError error) {
2023-01-25 07:55:18 +01:00
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) {