几个月前,我在 git bash (Git for Windows) 上安装了 zsh,然后安装了 oh-my-zsh 和 Windows Terminal,一切正常。最近,当我打开 Windows 终端时,出现一个错误,我无法找出并修复。有谁知道我该如何解决它?
打开 Windows 终端时出错:
(anon):15: can't set tty pgrp: operation not permitted
/c/Users/myUsername/.oh-my-zsh/tools/check_for_upgrade.sh:32: can't set tty pgrp: operation not permitted
/c/Users/myUsername/.oh-my-zsh/oh-my-zsh.sh:67: can't set tty pgrp: operation not permitted
/c/Users/myUsername/.oh-my-zsh/oh-my-zsh.sh:68: can't set tty pgrp: operation not permitted
compinit:539: can't set tty pgrp: operation not permitted
/c/Users/myUsername/.oh-my-zsh/lib/theme-and-appearance.zsh:35: can't set tty pgrp: operation not permitted
/c/Users/myUsername/.oh-my-zsh/lib/theme-and-appearance.zsh:43: can't set tty pgrp: operation not permitted
我的 Windows 终端配置:
{
"commandline": "%PROGRAMFILES%\\git\\usr\\bin\\bash.exe -i -l",
"cursorShape": "filledBox",
"fontFace": "MesloLGL NF",
"fontSize": 12,
"guid": "{00000000-0000-0000-ba54-000000000002}",
"icon": "%PROGRAMFILES%/Git/mingw64/share/git/git-for-windows.ico",
"name": "Bash",
"padding": "8",
"startingDirectory": "%USERPROFILE%",
"snapOnInput": true
}
我的.bash_profile
:
# Launch Zsh
if [ -t 1 ]; then
exec zsh
fi