Why do aliases with words not expand in big sur?
Solution 1:
$ alias --man
NAME
alias - define or display aliases
SYNOPSIS
alias [ options ] [name[=value]...]
DESCRIPTION
alias creates or redefines alias definitions or writes the existing alias definitions to standard output. An alias
definitions provides a string value that will replace a command name when the command is read. Alias names can
contain any printable character which is not special to the shell. If an alias value ends in a space or tab, then the
word following the command name the alias replaces is also checked to see whether it is an alias.
If you want your vscode alias to work, you need to do something like:
alias vscode='"visual studio code"'
So that the shell doesn't perform word-splitting on the string.
Example:
$ alias vscode='visual studio code'
$ vscode
ksh: visual: not found <= shell word-splitting
$ alias vscode='"visual studio code"'
$ vscode
ksh: visual studio code: not found <= shell not word-splitting
$
But what you really should do is follow VS Code's installation instructions for macOS, add /Applications/Visual Studio Code.app/Contents/Resources/app/bin
to your path, and run code
to start it.
$ path
/opt/local/bin
/opt/local/sbin
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
/Applications/VMware Fusion.app/Contents/Public
/Applications/Visual Studio Code.app/Contents/Resources/app/bin
/Users/mwilson/bin
/Users/mwilson/.local/bin
/Users/mwilson/Library/Python/3.9/bin
$ whence code
'/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code'
$