Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion session-manager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,13 @@ local function recreate_workspace(window, workspace_data)
local foreground_process = initial_pane:get_foreground_process_name()

-- Check if the foreground process is a shell
if foreground_process:find("sh") or foreground_process:find("cmd.exe") or foreground_process:find("powershell.exe") or foreground_process:find("pwsh.exe") or foreground_process:find("nu") then
if foreground_process and (
foreground_process:find("sh")
or foreground_process:find("cmd.exe")
or foreground_process:find("powershell.exe")
or foreground_process:find("pwsh.exe")
or foreground_process:find("nu")
) then
-- Safe to close
initial_pane:send_text("exit\r")
else
Expand Down