Support for Pre-execution Script in Windows Terminal #22936

Open
opened 2026-01-31 08:27:52 +00:00 by claunia · 0 comments
Owner

Originally created by @marcuwynu23 on GitHub (Feb 19, 2025).

Description of the new feature

🚀 Feature Request: Support for Pre-execution Script in Windows Terminal

Description

It would be beneficial if Windows Terminal supported pre-execution scripts, allowing users to run commands before opening a new terminal session.

🎯 Use Case

  • Users who frequently use doskey for aliasing commands (e.g., doskey gs=git status) have to manually add them to cmd.exe startup scripts.
  • A built-in mechanism to execute predefined scripts when launching Windows Terminal would improve automation and workflow efficiency.

💡 Proposed Solution

  • Add a pre-execution script option in Windows Terminal settings (settings.json).
  • Allow specifying a script (e.g., .cmd, .ps1, .bat) to run before the shell starts.

Example Implementation in settings.json:

{
  "profiles": {
    "defaults": {
      "preExecutionScript": "C:\\path\\to\\myscript.cmd"
    }
  }
}


### Proposed technical implementation details

_No response_
Originally created by @marcuwynu23 on GitHub (Feb 19, 2025). ### Description of the new feature # 🚀 Feature Request: Support for Pre-execution Script in Windows Terminal ## ✨ Description It would be beneficial if Windows Terminal supported **pre-execution scripts**, allowing users to run commands before opening a new terminal session. ## 🎯 Use Case - Users who frequently use `doskey` for aliasing commands (e.g., `doskey gs=git status`) have to manually add them to `cmd.exe` startup scripts. - A built-in mechanism to execute predefined scripts when launching Windows Terminal would improve automation and workflow efficiency. ## 💡 Proposed Solution - Add a **pre-execution script option** in Windows Terminal settings (`settings.json`). - Allow specifying a script (e.g., `.cmd`, `.ps1`, `.bat`) to run **before** the shell starts. ### Example Implementation in `settings.json`: ```json { "profiles": { "defaults": { "preExecutionScript": "C:\\path\\to\\myscript.cmd" } } } ### Proposed technical implementation details _No response_
claunia added the Issue-FeatureNeeds-TriageNeeds-Tag-Fix labels 2026-01-31 08:27:52 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#22936