Sometimes, with variable results. I think I've only observed it guess patterns from the current directory
> Does copilot work for shell scripts?
Yes, it gave me this earlier today while editing my .zshrc:
# kill a process on a given port
killport() {
lsof -i :$1 | awk 'NR!=1 {print $2}' | xargs kill
}