[PR #17388] Add support for local snippets in the CWD #31209

Open
opened 2026-01-31 09:45:49 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/17388

State: closed
Merged: Yes


This PR adds the ability to load snippets from the CWD into the suggestions UI.

If shell integration is disabled, then we only ever think the CWD for a pane is it's startingDirectory. So, in the default case, users can still stick snippets into the root of their git repos, and have the Terminal load them automatically (for profiles starting in the root of their repo).
If it's enabled though, we'll always try to load snippets from the CWD of the shell.

  • We cache the actions into a separate map of CWD -> actions. This lets us read the file only the first time we see a dir.
  • We clear that cache on settings reload
  • We only load sendInput actions from the .wt.json

As spec'd in #17329

**Original Pull Request:** https://github.com/microsoft/terminal/pull/17388 **State:** closed **Merged:** Yes --- This PR adds the ability to load snippets from the CWD into the suggestions UI. If shell integration is disabled, then we only ever think the CWD for a pane is it's `startingDirectory`. So, in the default case, users can still stick snippets into the root of their git repos, and have the Terminal load them automatically (for profiles starting in the root of their repo). If it's enabled though, we'll always try to load snippets from the CWD of the shell. * We cache the actions into a separate map of CWD -> actions. This lets us read the file only the first time we see a dir. * We clear that cache on settings reload * We only load `sendInput` actions from the `.wt.json` As spec'd in #17329
claunia added the pull-request label 2026-01-31 09:45:49 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#31209