LoginSignup
3
3

More than 5 years have passed since last update.

Visual Studio Codeでmsys2のzshを使う方法

Last updated at Posted at 2018-04-25

こっちの方を参考にしてください

    "terminal.integrated.shell.windows": "zsh.exeまでのパス",
    "terminal.integrated.env.windows": {
        "MSYSTEM": "MSYS",
        "CHERE_INVOKING": "1",
        "MSYS": "winsymlinks:nativestrict",
        "MSYS2_PATH_TYPE": "inherit"
    },
    "terminal.integrated.shellArgs.windows": [
        "--login",
        "-i"
    ],

元ネタ

Visual Studio Codeでmsys2のzshを使う方法

なんかうまいことやれた結果。

ビルド方法

shell
$ go build zsh-login.go

vscode内の設定

"terminal.integrated.shell.windows": "zsh-login.exeまでのパス"

code

zsh-login.go
package main

import (
    "fmt"
    "os"
    "os/exec"
)

func main() {
    os.Setenv("CHERE_INVOKING", "1")
    os.Setenv("MSYSTEM", "MSYS")
    os.Setenv("MSYS", "winsymlinks:nativestrict")
    cmd := exec.Command(`zsh.exeまでのパス`, `--login`, `-i`)
    cmd.Stdin = os.Stdin
    cmd.Stdout = os.Stdout
    cmd.Stderr = os.Stderr
    if err := cmd.Run(); err != nil {
        fmt.Fprintln(os.Stderr, err)
        os.Exit(1)
    }
}
3
3
1

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
3
3