From 0420ee3d52d95cc1c75fac9552f80317f8a41907 Mon Sep 17 00:00:00 2001 From: Jeremy Wootten Date: Tue, 19 Nov 2024 17:33:10 +0000 Subject: [PATCH] Provide fallback directory for active shell under test --- src/Widgets/TerminalWidget.vala | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Widgets/TerminalWidget.vala b/src/Widgets/TerminalWidget.vala index 51be8ad1ed..65109a32a3 100644 --- a/src/Widgets/TerminalWidget.vala +++ b/src/Widgets/TerminalWidget.vala @@ -648,8 +648,19 @@ namespace Terminal { string shell = Application.settings.get_string ("shell"); string?[] envv = null; - if (shell == "") + if (shell == "") { shell = Vte.get_user_shell (); + } + + if (shell == "") { + critical ("No user shell available"); + return; + } + + if (dir == "") { + debug ("Using fallback directory"); + dir = "/"; + } envv = { // Export ID so we can identify the terminal for which the process completion is reported