shell 分类

参考:

区别:

  • msys

    • cygwin
  • Msys mingw 64

    • x86_x64 windows
    • 提供基于 windows 的 程序和 mingw-w64 编译系统
  • Msys mingw 32

    • x86 windows

启动不同 msystem 的方法

参考:

  1. 使用 msys2_shell.cmd

    1
    
    E:\soft\msys64\msys2_shell.cmd -mingw64 -shell zsh
  2. 使用 env 命令

    1
    
    e:\msys64\usr\bin\env MSYSTEM=MSYS /usr/bin/bash -li
  3. .exe 工具

    1
    
    e:\msys64\usr\bin\mingw64 zsh
  4. mintty

    1
    
    E:\soft\msys64\usr\bin\mintty.exe -w hide /bin/env MSYSTEM=MINGW64 /bin/bash

调用 (在 windows 中) 调 msys2 命令

1
gitbash -c '/d/soft/executable.exe --args ARG'

格式: bash -c "{msys2 style path} {args}"

例子:

1
2
@echo off
gitbash -c /d/programs/emacs-chinese-word-segmentation/chinese-word-segmentation.exe %*

指定 msystem 再调用

msystem 是指 msys, mingw32, mingw64, ucrt64

eg:

1
E:\soft\msys64\msys2_shell.cmd -mingw64 -shell zsh -c emacs

隐藏 shell 窗口

1
E:\soft\msys64\usr\bin\mintty.exe -w hide /bin/env MSYSTEM=MINGW64 /bin/bash -lc emacs

换源

参考:

1
sed -i "s#mirror.msys2.org/#mirrors.tuna.tsinghua.edu.cn/msys2/#g" /etc/pacman.d/mirrorlist*