1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【VSCode】起動した際に自動でターミナルでコマンドを実行する方法

Posted at

拡張機能をインストール

Terminal Keeper という拡張機能をインストールします。

設定ファイルを作成

コマンドパレットを開き、「Terminal Keeper: Active Terminal Session」を実行し、「Yes」を選択します。
すると設定ファイルが生成されます。

configuration.gif

生成された設定ファイルにVSCode起動時に実行したいコマンドやアイコンなどを記述します。

.vscode/sessions.json
{
  "$schema": "https://cdn.statically.io/gh/nguyenngoclongdev/cdn/main/schema/v10/terminal-keeper.json",
  "theme": "tribe",
  "active": "default",
  "activateOnStartup": true,
  "keepExistingTerminals": false,
  "sessions": {
    "default": [
      {
        "name": "rails",
        "autoExecuteCommands": true,
        "icon": "ruby",
        "color": "terminal.ansiRed",
        "commands": ["rails s"]
      },
    ]
  }
}

上記の場合には起動時にターミナルが起動し、 rails s コマンドが実行されます。

設定項目の詳細については以下をご確認ください。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?