Vscode1.71.0终端报错提示`sed: illegal option -- r`

简介: Vscode1.71.0终端报错提示`sed: illegal option -- r`

问题描述

Mac环境下Vscode自带的终端无论什么命令都会出现sed提示,使用自带终端就没有问题

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

系统环境

# 系统版本
$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.14.4
BuildVersion:   18E2035
# vscode版本
$ code -v
1.71.0
784b0177c56c607789f9638da7b6bf3230d47a8c
x64

解决方式

参考issue可以很好的解决这个问题

官网也说将在下一个版本修复这个问题

修改文件/Applications/Visual StudioCode.app/Contents/Resources/app/out/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh

替换第125行

# __vsc_current_command="$(builtin history 1 | sed -r 's/ *[0-9]+ +//')"
__vsc_current_command="$(builtin history 1 | sed -E 's/ *[0-9]+ +//')"

参考

https://github.com/microsoft/vscode/issues/159864


相关文章
|
2月前
|
API C++
【Azure 环境】VS Code登录China Azure(Function)报错 An error occurred while signing in: invalid_request - AADSTS65002
An error occurred while signing in: invalid_request - AADSTS65002: Consent between first party application 'c27c220f-ce2f-4904-927d-333864217eeb' and first party resource '797f4846-ba00-4fd7-ba43-dac1f8f63013' must be configured via preauthorization - applications owned and operated by Microsoft mus
137 13
|
2月前
|
缓存 开发工具 C++
VS Code调试Function报错|无法加载Diagnostics.Abstractions怎么办?
在调试 Azure Function 时,可能出现 “Could not load file or assembly 'Microsoft.Extensions.Diagnostics.Abstractions, Version=8.0.0.0'” 错误,导致主机启动失败。本文详细解析该依赖加载错误的成因,并提供基于不同安装方式(NPM 或 MSI)的解决方案,涵盖重装 Core Tools、清理缓存、检查 .NET SDK 版本等操作步骤,同时提供日志排查与 Docker 容器化替代方案,帮助开发者快速恢复本地调试流程。
115 0
|
8月前
|
人工智能 自然语言处理 API
Cline:29.7K Star!一文详解VSCode最强开源AI编程搭子:一键生成代码+自动跑终端+操控浏览器...
Cline 是一款集成于 VSCode 的 AI 编程助手,支持多语言模型,实时检查语法错误,帮助开发者提高编程效率。通过智能化手段,Cline 可以生成代码、执行终端命令、调试 Web 应用,并扩展更多功能。
2471 73
解决Vscode使用LeetCode报错Failed to test the solution. Please open the output channel for details.
本文提供了解决在VScode中使用LeetCode插件时遇到“Failed to test the solution. Please open the output channel for details.”错误的方法,主要是通过修改setting.json文件中的输出文件夹配置来解决。
1155 1
|
TensorFlow 算法框架/工具 Python
【Mac 系统】解决VSCode用Conda成功安装TensorFlow但程序报错显示红色波浪线Unable to import ‘tensorflow‘ pylint(import-error)
本文解决在Mac系统上使用VSCode时遇到的TensorFlow无法导入问题,原因是Python解析器未正确设置为Conda环境下的版本。通过在VSCode左下角选择正确的Python解析器,即可解决import TensorFlow时报错和显示红色波浪线的问题。
631 9
vscode——如何将终端调整到右侧
vscode——如何将终端调整到右侧
227 1
安装VS Code报错:您选定的驱动器或UNC共享不存在或不能访问。请选择其他位置。
安装VS Code报错:您选定的驱动器或UNC共享不存在或不能访问。请选择其他位置。
|
JavaScript 前端开发 C++
【Azure Function】调试 VS Code Javascript Function本地不能运行,报错 Value cannot be null. (Parameter 'provider')问题
【Azure Function】调试 VS Code Javascript Function本地不能运行,报错 Value cannot be null. (Parameter 'provider')问题
123 0
|
Shell Windows
vscode添加gitbash终端(最新)
vscode添加gitbash终端(最新)
905 1
|
JavaScript Linux iOS开发
【Mac系统】Vscode使用LeetCode插件报错‘leetcode.toggleLeetCodeCn‘ not found
在Mac系统下使用VSCode的LeetCode插件时遇到“leetcode.toggleleetcodecn”命令找不到的错误解决方法,主要是通过从Nodejs官网下载并安装最新版本的Node.js来解决环境配置问题。
665 0