Skip to content
This repository has been archived by the owner on May 25, 2021. It is now read-only.

Feature: Default terminal settings #18

Closed
BenWildeman opened this issue Oct 27, 2017 · 2 comments
Closed

Feature: Default terminal settings #18

BenWildeman opened this issue Oct 27, 2017 · 2 comments

Comments

@BenWildeman
Copy link

BenWildeman commented Oct 27, 2017

It would be great if this had a setting for automatically opening terminals. In my local version I have added this, but I would like your thoughts on this before I submit a pull request with this feature.

Currently I have the following setting:

"terminalTabs.defaultTerminals": [{
  "name": "Terminal Name",
  "directory": "c:\\path\\to\\directory",
  "command" "command to start with when terminal created"
}]

Motivation

I personally have a workspace created in VS Code Insiders which has two directories. These directories are our API and Apps repositories. When I use this workspace, I'm constantly opening up 4 terminals. API terminal running API in dev mode, Apps terminal running in dev mode, and subsequent git terminals for managing these repositories.

By adding these terminals to the defaultTerminal settings outlined above within my .code-workspace file, these terminals automatically open when the workspace is opened, saving time and repeating mundane tasks.

Implementation

This is currently achieved by doing the following:

  • changing the "activationEvents" to "*"
  • calling the kill active terminal command to remove the stupid lingering terminal on vscode start
  • adding a sendCommand function to StatusBarTerminal
  • looping through the default terminals
    • setting name on creation
    • calling sendCommand with cd to the specified directory in the setting
    • calling sendCommand with the specified command in the setting

Questions

Are you happy with this implementation outlined above? Any suggestions going forward with this?

@Tyriar
Copy link
Owner

Tyriar commented Oct 27, 2017

I get the motivation but I don't think this is the right place to put the solution.

I also don't want to add much more to this extension as I'd rather focus efforts on adding splitting microsoft/vscode#7504 and proper tab support microsoft/vscode#10546 to VS Code.

@Tyriar Tyriar closed this as completed Oct 27, 2017
@Tyriar
Copy link
Owner

Tyriar commented Oct 27, 2017

@NiTrOGhost also thanks for prodding me on this, I did some long overdue dumping of my thoughts into microsoft/vscode#20013 (comment) and microsoft/node-pty#151 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants