
最近需要在 git bash 中跑 Claude Code 。git bash 是随 git for windows 套件安装的很久没更新了结果启动 Claude Code 报错Warning: no stdin data received in 3s, proceeding without it. If piping from a slow command, redirect stdin explicitly: /dev/null to skip, or wait longer.Error: Input must be provided either through stdin or as a prompt argument when using --print问题的原因是 Claude Code 需要一个完整的交互式终端环境启动时会尝试从标准输入stdin读取数据但 Git Bash 默认使用旧的终端模拟mintty 传统的 PTY 方式而不是 Windows 的 ConPTYConsole Pseudo Terminal。简单说Claude Code 需要一个完备的现代化的终端环境但 git bash 默认不是。解决方法也简单。1、临时方案在终端中输入export MSYSenable_pcon即可。但这样的话每次重启 git bash 都要输入命令很麻烦。2、自动化方案在 ~/.bashrc 或 ~/.bash_profile 末尾加上export MSYSenable_pcon然后重启 Git Bash。3、最佳方案去git 官网下载最新git for widows 套件https://git-scm.com/install/windows覆盖安装即可。如果不考虑旧版本兼容问题直接覆盖安装。另外安装时强烈建议勾选上Add a Git Bash Profile to Windows Treminal这样 Windows 终端中就可以启动 Git Bash了。搭上 Windows 终端不但显示效果上了个台阶操作便捷性也极大提升。首先是所有终端都可以结合到一个窗口中通过标签页切换复制/粘贴再也不用 Ctrl Ins/Shift Ins了好处多多。