-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]: zsh hangs forever after setting up aliases #40
Comments
@masewo : thank you for opening this issue! 🙇 Being a Zsh user, I'd like to figure out how to replicate this and what might be causing this.
Showing my simplified setup~ $ zsh --version
zsh 5.9 (x86_64-apple-darwin23.0)
~ $ cat ~/.zshrc
export EDITOR=vim
export PATH=/usr/local/opt/go/libexec/bin:$HOME/go/bin:$HOME/.dotnet:$HOME/bin:$PATH
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="risto"
plugins=(git)
source $ZSH/oh-my-zsh.sh
alias vim="vim -o"
alias mvim="mvim -o"
export GH_PAGER="cat"
eval "$(gh copilot alias -- zsh)"
~ $ declare -f ghcs
ghcs () {
FUNCNAME="$funcstack[1]"
TARGET="shell"
local GH_DEBUG="$GH_DEBUG"
read -r -d '' __USAGE <<EOF
Wrapper around \`gh copilot suggest\` to suggest a command based on a natural language description of the desired output effort.
Supports executing suggested commands if applicable.
USAGE
$FUNCNAME [flags] <prompt>
FLAGS
-d, --debug Enable debugging
-h, --help Display help usage
-t, --target target Target for suggestion; must be shell, gh, git
default: "$TARGET"
EXAMPLES
- Guided experience
$ $FUNCNAME
- Git use cases
$ $FUNCNAME -t git "Undo the most recent local commits"
$ $FUNCNAME -t git "Clean up local branches"
$ $FUNCNAME -t git "Setup LFS for images"
- Working with the GitHub CLI in the terminal
$ $FUNCNAME -t gh "Create pull request"
$ $FUNCNAME -t gh "List pull requests waiting for my review"
$ $FUNCNAME -t gh "Summarize work I have done in issues and pull requests for promotion"
- General use cases
$ $FUNCNAME "Kill processes holding onto deleted files"
$ $FUNCNAME "Test whether there are SSL/TLS issues with github.com"
$ $FUNCNAME "Convert SVG to PNG and resize"
$ $FUNCNAME "Convert MOV to animated PNG"
EOF
local OPT OPTARG OPTIND
while getopts "dht:-:" OPT
do
if [ "$OPT" = "-" ]
then
OPT="${OPTARG%%=*}"
OPTARG="${OPTARG#"$OPT"}"
OPTARG="${OPTARG#=}"
fi
case "$OPT" in
(debug | d) GH_DEBUG=api ;;
(help | h) echo "$__USAGE"
return 0 ;;
(target | t) TARGET="$OPTARG" ;;
esac
done
shift "$((OPTIND-1))"
TMPFILE="$(mktemp -t gh-copilotXXX)"
trap 'rm -f "$TMPFILE"' EXIT
if GH_DEBUG="$GH_DEBUG" gh copilot suggest -t "$TARGET" "$@" --shell-out "$TMPFILE"
then
if [ -s "$TMPFILE" ]
then
FIXED_CMD="$(cat $TMPFILE)"
print -s "$FIXED_CMD"
echo
eval "$FIXED_CMD"
fi
else
return 1
fi
} |
@andyfeller I installed it on two nearly identical Macs. On one it worked fine out of the box (it already had preinstalled an earlier version of GitHub Copilot CLI and was upgraded today) the other problematic machine never had GitHub Copilot CLI installed before. I cannot reproduce the error now anymore because I "fixed" it by accepting data collection manually. Do you know how I can revert this? |
$ gh copilot config
? What would you like to configure?
> Optional Usage Analytics
? Allow GitHub to collect optional usage data to help us improve? This data does not include your queries.
> No |
@your-diary Thanks. I mean how can the setting be reverted to "unset"? Maybe deleting some internal config file? |
|
Thanks. Executing these commands:
Now I have again the following behaviour: Open a new iTerm2 tab results in a hanging shell:
If I cancel it with CTRL + C I get:
@andyfeller |
@masewo @your-diary : Okay, I think I understand what's going on here. 🤦 Thank you again for patience In the case you have never used As a short term workaround, either of the following should workaround the issue until a patch can be issued:
|
similar problem I add
to my
I have open anonymized telemetry |
This also happens in bash, when you run If you press the down (or up) arrow key before pressing Strl+C, it will execute the `yes' command, which spams the letter y into the console....
If you need this telemetry check, please generate valid bash code like echo aliases not generated, please ... |
What happened?
echo 'eval "$(gh copilot alias -- zsh)"' >> ~/.zshrc
After executing this command the
zsh
does not start anymore. It hangs forever but it can be aborted with CTRL + C.Expectation:
zsh
works with aliases setup.Can be healed by running one time manually
gh copilot alias -- zsh
and accepting the data collecting.Versions
gh v2.46.0, gh-copilot v1.0.0
Relevant terminal output
none
The text was updated successfully, but these errors were encountered: