Skip to content

v20260806-nightly

@gnachman gnachman tagged this 06 Aug 00:21
When a session's saved working directory no longer exists (for example,
it was on an external or network drive that is not mounted at launch),
restoring it could fail to relaunch the shell and silently close the
tab.

Two things went wrong. On the posix_spawn launch path (used when
"Disclaim ownership of children" is enabled), the working directory was
applied with posix_spawn_file_actions_addchdir_np, whose failure aborts
the entire spawn. The shell never execs, the session gets an immediate
broken pipe, and because it ended right after starting, the tab is
closed. This differs from the fork+exec path, whose chdir() failure is
silently ignored so the shell still launches in a fallback directory.

Fixes:
- iTermSessionFactory now checks whether the resolved working directory
  exists before launch and, if not, falls back to the home directory and
  records the original path. After the shell starts, the session shows a
  banner explaining that it started in the home directory instead. This
  is skipped for ssh (remote paths) and for attach (no shell launch).
- iTermSpawnInitializeActions only adds the chdir file action when the
  directory exists, so a missing directory can no longer abort the spawn.
  This makes the posix_spawn path best-effort like the fork path and is
  defense in depth against the same directory vanishing after the check.
Assets 2
Loading