skip to Main Content

Reopened VS Code after committing earlier to find this message

sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]

Did I do something to my terminal or is this like an update or something?

Thanks again.

4

Answers


  1. maybe something is wrong in your PATH setting, hope this can help you to check the PATH:

    sed --version
    which -a sed
    type -a sed
    echo $PATH
    
    Login or Signup to reply.
  2. Some versions of sed have a -r option and some don’t. (It means "use extended regular expressions"—i.e., POSIX EREs—on those that do have it.) Some program you’re running is trying to invoke sed -r, and the sed you’re getting when this program runs is one that lacks the -r option.

    Your choices at this point include:

    • stop running that program (whatever it is—it’s not Git);
    • find that program and fix it to not require -r;
    • install a version of sed that handles -r.
    Login or Signup to reply.
  3. There seem the be a bug in VScode v1.71.0 which gives this error on MacOS machines.

    https://github.com/microsoft/vscode/commit/e55863c5c1fc4515bd99e9cd4fb415788000a8b1

    Login or Signup to reply.
  4. I had the same problem after updating to August 2022 (version 1.71) on my Mac OS 10.13.6. I installed the previous release and then noticed a warning in the terminal

    screenshot of terminal with warning icon

    I hovered over the warning icon and then saw a message box:

    Extensions want to make the following changes to the terminal’s
    environment:

    GIT_ASKPASS=/Applications/Visual Studio
    Code.app/Contents/Resources/app/extensions/git/dist/askpass.sh
    VSCODE_GIT_ASKPASS_NODE=/Applications/Visual Studio
    Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code
    Helper VSCODE_GIT_ASKPASS_MAIN=/Applications/Visual Studio
    Code.app/Contents/Resources/app/extensions/git/dist/askpass-main.js

    I clicked on the "Relaunch terminal" link, and the problem was resolved.

    I tried updating once again but the warning didn’t show up.

    As mentioned by Sabrina N, it’s a VSCode bug in the current release.

    I haven’t experienced any problems working with the current release and subscribed to the issue for updates.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search