Restore previous directories when using "Open windows from a previous session" #17785

Open
opened 2026-01-31 05:53:23 +00:00 by claunia · 0 comments
Owner

Originally created by @alexgeek on GitHub (Jun 23, 2022).

Description of the new feature/enhancement

I generally have about 5 powershell tabs open that are coloured and named for different projects I between.
When I restart my PC windows terminal opens back up with the same tab names / colours due to the "Open windows from a previous session" setting but I then have to CD into all the directories. It would be a great improvement to automatically CD into the last used directory per tab.

Proposed technical implementation details (optional)

I'm not sure myself as not familiar with the codebase but I imagine could be something like:

  • on close for each tab
  • cache pwd
  • on open for each tab
  • cd to cached pwd

Would likely need to be enabled per profile as some may not even have these commands.

Originally created by @alexgeek on GitHub (Jun 23, 2022). # Description of the new feature/enhancement I generally have about 5 powershell tabs open that are coloured and named for different projects I between. When I restart my PC windows terminal opens back up with the same tab names / colours due to the "Open windows from a previous session" setting but I then have to CD into all the directories. It would be a great improvement to automatically CD into the last used directory per tab. # Proposed technical implementation details (optional) I'm not sure myself as not familiar with the codebase but I imagine could be something like: - on close for each tab - cache `pwd` - on open for each tab - `cd` to cached `pwd` Would likely need to be enabled per profile as some may not even have these commands.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17785