使用 mintty 作为 Cygwin 上的默认终端和默认 shell 作为 bash

kan*_*nna 10 terminal cygwin

Best way to use a shell with Cygwin in Windows 7 中已经有人回答了这个问题。那就是启动 CygwinC:\cygwin\bin\mintty.exe -

接着就,随即 $SHELL = /bin/sh

如何使用/usr/bin/bash默认 shell启动 mintty ?

Jam*_*ger 14

有几种不同的方法可以做到:

  1. bash如 Salton 所述,指定为 mintty 的命令行参数。
  2. 将 WindowsSHELL环境变量设置为 /usr/bin/bash。
  3. 确保您的 Cygwin 环境中有一个 /etc/passwd(请参阅 mkpasswd(1)),并将您的 UID 的 shell 设置为 /usr/bin/bash。Cygwin 不提供 chsh 或 usermod 命令,因此如果要使用此方法,您可能必须手动编辑文件。

从 mintty(1) 联机帮助页:

INVOCATION
   If a program name is supplied on the command line, this is executed
   with any additional arguments given.  Otherwise, mintty looks for a
   shell to execute in the SHELL environment variable.  If that is not
   set, it reads the user's default shell setting from /etc/passwd.  As a
   last resort, it falls back to /bin/sh.  If a single dash is specified
   instead of a program name, the shell is invoked as a login shell.
Run Code Online (Sandbox Code Playgroud)


Raz*_*aza 5

您可以启动mintty bashbash 为默认值