I just updated my Visual Studio application (now 1.71.0 (Universal)) on my Mac (High Sierra), and I noticed that when I start up my terminal in VSCode, that I get this message with every command that I run:
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
I think this has something to do with me updating VS Code, but I don't know why or how to fix it. Has anyone run into this before?
Please, see the following references:
The solution is:
As per the GitHub issue comment:
Tyriar commented 2022-09-12T12:54:25Z
The fix for this is coming in 1.71.2, not sure on the release date currently.
1.71.2Please, see the GitHub issue: sed -r shell integration error on OSX · Issue #159946 · microsoft/vscode · GitHub.
Please, note the workaround-related comment:
Tyriar commented 2022-09-02T19:31:19Z
See comments in e55863c
sed -r doesn't work on OSX Catalina, I get an error at each command in the integrated terminal
Workaround for anyone hitting this is to set
HISTCONTROLto one oferasedups,ignoreboth,ignoredupsin your~/.bashrc.
The solution is to override («replace») the macOS (BSD) sed with the GNU sed.
For example, please, refer:
Question. How do I fix "sed: illegal option -- r" in macOS Sierra Android build? - Stack Overflow.
Question. macos - How to use GNU sed on Mac OS 10.10+, 'brew install --default-names' no longer supported - Stack Overflow.
This may not be the most technically savvy solution, but I did this:
Install gsed:
brew install gnu-sed
Make a symbolic link to gsed:
cd /usr/local/bin
ln -s gsed sed
When VSCode fixes the issue, I will delete the symbolic link, and uninstall gsed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With