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
I like to use ?? and ?! as aliases for ghcs and ghce. At the moment I'm able to do this by first calling the alias eval and then assigning my own aliases:
eval"$(gh copilot alias -- zsh)"alias -- '?!'=ghce
alias -- '??'=ghcs
It would however be much nicer to directly define the aliases. Something like this maybe?
eval"$(gh copilot alias --suggest='??' --explain='?!' -- zsh)"
The text was updated successfully, but these errors were encountered:
Would you expect the existing functions preserved and simply add alias statements to the output?
Yeah I think that's good. I'd suggest prepending the function with underscores though:
$ gh copilot alias --suggest='??' --explain='?!' -- zsh
_ghcs() {
...
}
_ghce() {
...
}
alias -- '?!'=_ghce
alias -- '??'=_ghcs
Are there any inputs that would be invalid or dangerous to allow being used?
I'm not sure, but if the user provides invalid arguments they will see as soon as the eval runs, right? And sure you can do stupid stuff like alias -- 'bash', but that's definitely user fault.
Good call out about namespacing the functions. 🤔 I also agree that anything the user plugs in would be their fault if it doesn't work as expected; you should know the limitations of your shell when customizing it.
I like to use
??
and?!
as aliases forghcs
andghce
. At the moment I'm able to do this by first calling the alias eval and then assigning my own aliases:It would however be much nicer to directly define the aliases. Something like this maybe?
The text was updated successfully, but these errors were encountered: