Save/restore shell directory stack
Feature Request
Summary
When I save and restore a window arrangement, it would be nice to preserve the shell directory stack (pushd in most common shells). Same for a restart when I update to a new version.
Alternatives
There are no good alternatives. Typically I have a few windows, each containing a few tabs, permanently open. I work on a different topic in each tab (I use the tab label to distinguish them). After an automatic restart (installation of new version), or after a manual windows restore, I need to setup the shell directory stack in each tab, or at least in the tabs that I currently work, which is not convenient. Configuring the directory stacks with a script is not convenient: (1) it is very dynamic, so any configuration becomes outdated after some time (I just need the last setup before restart/restore), and (2) I need multiple scripts to configure multiple tabs.
The inconvenience of having to remember and setup manually the directory stack in each tab, is the main reason I postpone the installation of new versions as much as I can (usually I update iTerm2 only when I update macOS).
Concerns
In case of nested shells, it is preferable to store the directory stack of the inner (active) shell. In my use case, I use nested shell only in administration tabs, in which I only run sudo in the outer shell.
This feature might be disturbing for common use cases, so it could be offered as an option which is disabled by default. E.g., in case of remote login, the active directory stack is at the remote shell, but after restart/restore it will be applied to the local shell.