Execute default commands => terminal launch or new tab #10408

Open
opened 2026-01-31 02:20:47 +00:00 by claunia · 0 comments
Owner

Originally created by @V1NAY8 on GitHub (Aug 31, 2020).

Description of the new feature/enhancement

  • I want a terminal configuration where I should be able to run a command automatically on launching it.
  • No need to check if the command is working.
  • Support for multiple commands.

Whom this is helpful for?

  • Developers who want to setup environment using script. ( ./runWhileTerminalLaunches.sh)
  • Execute git any commands (git fetch --dry-run)

Proposed technical implementation details (optional)

For Example:

  • Consider a Scenario using python virtual environment.
  • So each time opening a new tab, a command has to be executed to activate the virtual environment.
  • Assume I created a virtualenv for python named venv.
  • In settings.json add "defaultCommand" along with the command to execute
{
    "guid": "{2c4de342-38b7-51cf-b940-2309a097f518}",
    "hidden": false,
    "name": "Ubuntu",
    "source": "Windows.Terminal.Wsl",
    "defaultCommand": "source /mnt/c/Work/venv/bin/activate"
}
  • So when I open a new tab it runs the command and sets my environment.
source /mnt/c/Work/venv/bin/activate
(venv)
Originally created by @V1NAY8 on GitHub (Aug 31, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement - I want a terminal configuration where I should be able to run a command automatically on launching it. - No need to check if the command is working. - Support for multiple commands. ### Whom this is helpful for? - Developers who want to setup environment using script. ( ./runWhileTerminalLaunches.sh) - Execute git any commands (git fetch --dry-run) # Proposed technical implementation details (optional) For Example: - Consider a Scenario using python virtual environment. - So each time opening a new tab, a command has to be executed to activate the virtual environment. - Assume I created a virtualenv for python named **venv**. - In settings.json add "defaultCommand" along with the command to execute ```json { "guid": "{2c4de342-38b7-51cf-b940-2309a097f518}", "hidden": false, "name": "Ubuntu", "source": "Windows.Terminal.Wsl", "defaultCommand": "source /mnt/c/Work/venv/bin/activate" } ``` - So when I open a new tab it runs the command and sets my environment. ```bash source /mnt/c/Work/venv/bin/activate (venv) ```
claunia added the Issue-FeatureNeeds-TriageNeeds-Tag-Fix labels 2026-01-31 02:20:48 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#10408