该扩展通过修改 VS Code 的 html 文件实现效果,遇到问题需参考 Common Issues 文档;在线图片仅允许 https 协议;从 v1 升级到 v3 后不再支持旧的顶层配置,需按迁移文档调整

vscode-background
shalldieMIT活跃维护给 VS Code 编辑器添加背景图片的扩展插件,支持自定义图片和透明度,让写代码的界面不再单调。
Bring background images to your vscode. vscode background 背景扩展插件。
在 VS Code 扩展市场搜索 shalldie.background 安装,或从 Marketplace 页面安装README 未说明
给 VS Code 加背景图的扩展,支持编辑器、侧边栏、全屏等多区域自定义图片
给 VS Code 编辑器添加背景图片的扩展插件,支持自定义图片和透明度,让写代码的界面不再单调。
核心能力
- 为 editor、sidebar、auxiliarybar、panel、fullscreen 分别配置背景图
- 支持在线 https 图片、本地文件、文件夹、data URL 等多种来源
- 可设置轮播间隔与随机显示,实现背景图自动切换
- 通过 style、styles、opacity、size、position 精细控制显示效果
- 状态栏 Background 按钮集中提供所有相关命令
容易踩的坑
- v3.1.0最新正式版2026-09-11 · 2026-09-11 02:49 UTC
What's Changed
- fix: avoid corrupting CSP directives when injecting inline script support by @Moli13337 in https://github.com/shalldie/vscode-background/pull/631
- fix: apply editor background in floating editor windows (fix #633) by @mods-hd in https://github.com/shalldie/vscode-background/pull/634
New Contributors
- @Moli13337 made their first contribution in https://github.com/shalldie/vscode-background/pull/631
- @mods-hd made their first contribution in https://github.com/shalldie/vscode-background/pull/634
Full Changelog: https://github.com/shalldie/vscode-background/compare/v3.0.1...v3.1.0
- v3.0.12026-08-05 · 2026-08-05 07:37 UTC
查看更新说明
- fix: patch 写入失败(如 code-server 等只读环境)时不再触发 reload,保留错误提示 by @shalldie
Full Changelog: https://github.com/shalldie/vscode-background/compare/v3.0.0...v3.0.1
- v3.0.02026-07-31 · 2026-07-31 09:47 UTC
查看更新说明
- BREAKING refactor: 移除 v1 旧配置支持 by @shalldie
- feat: 为 fullscreen/sidebar/panel/auxiliarybar 添加逐图 styles 配置 in #592
- feat: 支持在图片路径中使用
~和环境变量 in #612 - chore: 工程结构优化、依赖升级、静态资源与冗余代码清理
Full Changelog: https://github.com/shalldie/vscode-background/compare/v2.1.2...v3.0.0
- v2.1.22026-07-07 · 2026-07-07 11:01 UTC
查看更新说明
What's Changed
- fix: support electron-sandbox path for some version of Cursor by @hedgehog-ha in https://github.com/shalldie/vscode-background/pull/614
New Contributors
- @hedgehog-ha made their first contribution in https://github.com/shalldie/vscode-background/pull/614
Full Changelog: https://github.com/shalldie/vscode-background/compare/v2.1.1...v2.1.2
- v2.1.12026-06-08 · 2026-06-08 07:34 UTC
查看更新说明
What's Changed
- fix: fix sudo/admin option by @shalldie in https://github.com/shalldie/vscode-background/pull/605
Full Changelog: https://github.com/shalldie/vscode-background/compare/v2.1.0...v2.1.1
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。

Bring background images to your Visual Studio Code
fullscreen, editor, sidebar, auxiliarybar, panel, carousel, custom images/styles...
GitHub | Visual Studio Marketplace
Multiple sections, editor, sidebar, auxiliarybar, panel
fullscreen
Installation
There are 2 ways to install this extension:
- Install from Visual Studio Marketplace.
- Search
shalldie.backgroundfrom vscode.
Custom
User defined requirements can be met by changing the configuration(settings.json).
Config
Global Config
| Name | Type | Default | Description |
|---|---|---|---|
background.enabled | Boolean | true | Whether to enable background extension. |
Editor Section Config
Edit background.editor to config editor section.
| Name | Type | Default | Description |
|---|---|---|---|
useFront | boolean | true | Place the image above or below the code. |
style | object | {} | Custom style for images. MDN Reference |
styles | object[] | [] | Custom style for each image individually. |
images | string[] | [] | Custom images, supports online and local images, as well as folders. |
interval | number | 0 | Seconds of interval for carousel, default 0 to disabled. |
random | boolean | false | Whether to randomly display images. |
example:
{
"background.editor": {
"useFront": true,
"style": {
"background-position": "100% 100%",
"background-size": "auto",
"opacity": 0.6
},
"styles": [],
// `images` supports online and local images, as well as folders.
"images": [
// online images, only `https` is allowed.
"https://hostname/online.jpg",
// local images
"file:///local/path/img.jpeg",
"/home/xie/downloads/img.gif",
"C:/Users/xie/img.bmp",
"D:\\downloads\\images\\img.webp",
// `~` and environment variables are supported in local paths
"~/Pictures/img.png",
"${HOME}/Pictures/img.png",
// local folders
"/home/xie/images",
// data URL
"data:image/*;base64,<base64-data>"
],
"interval": 0,
"random": false
}
}
Fullscreen, Sidebar, Auxiliarybar, Panel Section Config
Edit background.fullscreen, background.sidebar, background.auxiliarybar, background.panel to config these sections.
| Name | Type | Default | Description |
|---|---|---|---|
images | string[] | [] | Custom images, supports online and local images, as well as folders. |
opacity | number | 0.1 | Opacity of the images, alias to opacity, 0.1 ~ 0.3 recommended. |
size | string | cover | Alias to background-size, cover to self-adaption (recommended). |
position | string | center | Alias to background-position, default center. |
styles | object[] | [] | Custom style for each image individually. |
interval | number | 0 | Seconds of interval for carousel, default 0 to disabled. |
random | boolean | false | Whether to randomly display images. |
example:
{
"background.fullscreen": {
// `images` supports online and local images, as well as folders.
"images": [
// online images, only `https` is allowed.
"https://hostname/online.jpg",
// local images
"file:///local/path/img.jpeg",
"/home/xie/downloads/img.gif",
"C:/Users/xie/img.bmp",
"D:\\downloads\\images\\img.webp",
// `~` and environment variables are supported in local paths
"~/Pictures/img.png",
"${HOME}/Pictures/img.png",
// local folders
"/home/xie/images",
// data URL
"data:image/*;base64,<base64-data>"
],
"opacity": 0.1,
"size": "cover",
"position": "center",
"styles": [],
"interval": 0,
"random": false
},
// `sidebar` and `panel` have the same config as `fullscreen`
"background.sidebar": {},
"background.panel": {}
}
Quick Command
Click the 「Background」 button on the right-bottom of statusbar, all commands of background will appear:
Common Issues
This extension works by editing the vscode's html file.
Please refer to the Common Issues if you met some problems.
Uninstall
Please refer to Common Issues#how-to-uninstall.
Contributors 🙏
Contributing Guide
Refer to Contributing Guide.
Change Log
You can checkout all our changes in our CHANGELOG.
Share Your Images
We share background images here.
Migration from v1
Starting from v3.0, v1 top-level configuration is no longer supported. Please refer to migration-from-v1.md to migrate.
LICENSE
MIT