You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 30, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Oct 30, 2025. It is now read-only.
[BUG]: eval "$(gh copilot alias -- bash)" takes 0.5 second to load #88
What did you do? What happened? What did you expect to happen?
eval "$(gh copilot alias -- bash)" took 0.5 sec to load (I'm the "User is not authorized to use this Copilot feature"). I'd expect it to load much faster as 0.5 sec is a way too slow.
Versions
What versions of the relevant software are you running? For example: gh v2.37.0, gh-copilot v0.5.2-beta
gh version 2.52.0 (2024-06-24)
version 1.0.3 (2024-05-08)
Relevant terminal output
Please copy and paste any relevant terminal output. Please check your output before submission to ensure sensitive information is redacted.
>timeeval"$(gh copilot alias -- bash)"
real 0m0,611s
user 0m0,210s
sys 0m0,053s
and another workstation:
>timeeval"$(gh copilot alias -- bash)"
real 0m0,548s
user 0m0,156s
sys 0m0,037s
I have the same issue using eval "$(gh copilot alias -- zsh)" on macOS. Strangely, the entire script to be evaluated is emitted instantly, it's just that the gh command takes a long time to exit.
@BagToad That helped performance a bit, but only reduced from 0.11s to 0.07s (according to time). As I noted initially, the issue is after the script is emitted, suggesting that it's an issue with the exit time, not the startup time. Additionally, I notice this slow exit consistently across all gh copilot commands (even gh copilot --help), but the root gh command is fast.
>export TCELL_MINIMIZE=1
>timeeval"$(gh copilot alias -- bash)"
real 0m1,250s
user 0m0,167s
sys 0m0,080s
# second run>timeeval"$(gh copilot alias -- bash)"
real 0m1,116s
user 0m0,120s
sys 0m0,037s
Same problem here and even slower in my good old Macpro: 1.7 sec. Ok, it is only a 12 core 3.3 Ghz Xeon but still: nothing it that slow.
In the meantime, I've decided to cache it each day, commenting the line out and adding this to my .bashrc:
# Define the path to the .ghrc file
GHRC_PATH="$HOME/.ghrc"
# Check if the file exists and is older than 1 day
if [[ ! -f "$GHRC_PATH" || $(find "$GHRC_PATH" -mtime +0 -print) ]]; then
echo "Updating .ghrc file..."
gh copilot alias -- bash > "$GHRC_PATH"
fi
# Evaluate the content of the .ghrc file
if [[ -f "$GHRC_PATH" ]]; then
echo "Evaluating .ghrc file..."
source "$GHRC_PATH"
else
echo "Error: .ghrc file not found after update."
exit 1
fi
Activity
jarrodldavis commentedon Nov 20, 2024
I have the same issue using
eval "$(gh copilot alias -- zsh)"on macOS. Strangely, the entire script to be evaluated is emitted instantly, it's just that theghcommand takes a long time to exit.BagToad commentedon Nov 20, 2024
I suspect this actually has more to do with
ghstartup time than thegh-copilotextension - see cli/cli#9724@yermulnik @jarrodldavis, could you try setting
TCELL_MINIMIZE=1and let us know if that improves the performance?jarrodldavis commentedon Nov 20, 2024
@BagToad That helped performance a bit, but only reduced from 0.11s to 0.07s (according to
time). As I noted initially, the issue is after the script is emitted, suggesting that it's an issue with the exit time, not the startup time. Additionally, I notice this slow exit consistently across allgh copilotcommands (evengh copilot --help), but the rootghcommand is fast.yermulnik commentedon Nov 20, 2024
🤔
BagToad commentedon Nov 20, 2024
Ah, thanks for trying that out! Sounds like we have more investigating to do 😁
pmeheut commentedon Jan 16, 2025
Same problem here and even slower in my good old Macpro: 1.7 sec. Ok, it is only a 12 core 3.3 Ghz Xeon but still: nothing it that slow.
In the meantime, I've decided to cache it each day, commenting the line out and adding this to my .bashrc:
GriwMF commentedon Jan 18, 2025
Have the same issue with bash in Arch under wsl
As a temporary fix I did
gh copilot alias -- bash > .bash_copilot_aliasesand then loaded it in my .bashrc