Find a file
Ichimura Tomoo 6b90aaa1bd
status_bar: Add encoding indicator (#45476)
## Context / Related PRs This PR is the third part of the encoding
support improvements, following:
- #44819: Introduced initial legacy encoding support (Shift-JIS, etc.).
- #45243: Fixed UTF-16 saving behavior and improved binary detection.

## Summary
This PR implements a status bar item that displays the character
encoding of the active buffer (e.g., `UTF-8`, `Shift_JIS`). It provides
visibility into the file's encoding and indicates the presence of a Byte
Order Mark (BOM).

## Features
- **Encoding Indicator**: Displays the encoding name in the status bar.
- **BOM Support**: Appends `(BOM)` to the encoding name if a BOM is
detected (e.g., `UTF-8 (BOM)`).
- **Configuration**: The active_encoding_button setting in status_bar
accepts "enabled", "disabled", or "non_utf8". The default is "non_utf8",
which displays the indicator for all encodings except standard UTF-8
(without BOM).
- **Settings UI**: Provides a dropdown menu in the Settings UI to
control this behavior.
- **Documentation**: Updated `configuring-zed.md` and
`visual-customization.md`.

## Implementation Details
- Created `ActiveBufferEncoding` component in
`crates/encoding_selector`.
- The click handler for the button is currently a **no-op**.
Implementing the functionality to reopen files with a specific encoding
has potential implications for real-time collaboration (e.g., syncing
buffer interpretation across peers). Therefore, this PR focuses strictly
on the visualization and configuration aspects to keep the scope simple
and focused.
- Updated schema and default settings to include
`active_encoding_button`.

## Screenshots

<img width="487" height="104" alt="image"
src="https://github.com/user-attachments/assets/041f096d-ac69-4bad-ac53-20cdcb41f733"
/>
<img width="454" height="99" alt="image"
src="https://github.com/user-attachments/assets/ed76daa2-2733-484f-bb1f-4688357c035a"
/>


## Configuration
To hide the button, add the following to `settings.json`:
```json
"status_bar": {
  "active_encoding_button": "disabled"
}
```

- **enabled**: Always show the encoding.
- **disabled**: Never show the encoding.
- **non_utf8**: Shows for non-UTF-8 encodings and UTF-8 with BOM. Only
hides for standard UTF-8 (Default).

<img width="1347" height="415" alt="image"
src="https://github.com/user-attachments/assets/7f4f4938-3320-4d21-852c-53ee886d9a44"
/>

## Heuristic Limitations:
The underlying detection logic (implemented in #44819 and #45243)
prioritizes UTF-8 opening performance and does not guarantee perfect
detection for all encodings. We consider this margin of error
acceptable, similar to the behavior seen in VS Code. A future "Reopen
with Encoding" feature would serve as the primary fallback for any
misdetections.

Release Notes:

- Added a status bar item to display the active file's character encoding (e.g. `UTF-16`). This shows for non-utf8 files by default and can be configured with `{"status_bar":{"active_encoding_button":"disabled|enabled|non_utf8"}}`
2026-01-07 07:24:46 +00:00
.cargo ci: Update typos versions and fix new occurrences (#40784) 2025-10-21 10:43:22 +00:00
.cloudflare docs: Document context servers (#21170) 2024-11-25 11:05:14 -05:00
.config ci: Run slow tests first (#40769) 2025-10-21 09:58:26 +02:00
.factory/prompts/docs-automation docs: Automatic Documentation Github Action using Droid (#45374) 2025-12-19 11:19:12 -06:00
.github extension_ci: Be more explicit with version bump (#46208) 2026-01-07 00:22:44 +00:00
.zed worktree: Implement read_only_files worktree setting (#44376) 2026-01-04 13:18:34 +00:00
assets status_bar: Add encoding indicator (#45476) 2026-01-07 07:24:46 +00:00
ci Move Nightly release to gh-workflow (#41349) 2025-10-28 13:57:23 -06:00
crates status_bar: Add encoding indicator (#45476) 2026-01-07 07:24:46 +00:00
docs status_bar: Add encoding indicator (#45476) 2026-01-07 07:24:46 +00:00
extensions extension_ci: Move shared workflows into nested folder (#45828) 2025-12-29 16:44:47 +00:00
legal Fix the markdown table (#38729) 2025-09-23 16:49:45 +00:00
nix nix: Pin cargo-about to 0.8.2 (#44901) 2025-12-16 11:00:46 -08:00
plans Improve visual test runner: consolidate setup, add constants, remove dead code (#46217) 2026-01-06 22:57:13 -05:00
script Rename visual_test_runner to zed_visual_test_runner (#46171) 2026-01-06 13:28:58 -05:00
tooling extension_ci: Be more explicit with version bump (#46208) 2026-01-07 00:22:44 +00:00
.clinerules Initial .rules file for agent with symlinks for other rules file paths (#29014) 2025-04-17 23:41:23 +00:00
.cursorrules Initial .rules file for agent with symlinks for other rules file paths (#29014) 2025-04-17 23:41:23 +00:00
.git-blame-ignore-revs Add PR 15352 to .git-blame-ignore-revs (#30870) 2025-05-17 11:35:58 +00:00
.gitattributes windows: Make sure zed.sh using the correct line ending (#37650) 2025-09-05 16:25:55 +00:00
.gitignore Screenshot testing (#45259) 2026-01-05 16:34:36 -05:00
.mailmap Blockmap sync fix (#44743) 2025-12-17 16:14:57 +00:00
.prettierrc ci: Add check for formatting default.json (#30034) 2025-05-06 18:55:26 +00:00
.rules project: Properly set up the terminal env in remote shells (#46149) 2026-01-06 10:27:17 +00:00
.windsurfrules Initial .rules file for agent with symlinks for other rules file paths (#29014) 2025-04-17 23:41:23 +00:00
Cargo.lock status_bar: Add encoding indicator (#45476) 2026-01-07 07:24:46 +00:00
Cargo.toml status_bar: Add encoding indicator (#45476) 2026-01-07 07:24:46 +00:00
CLAUDE.md Initial .rules file for agent with symlinks for other rules file paths (#29014) 2025-04-17 23:41:23 +00:00
clippy.toml gpui: Fix some memory leaks on macOS platform (#44639) 2025-12-15 17:37:27 +00:00
CODE_OF_CONDUCT.md Remove community content from docs and point to zed.dev (#19895) 2024-10-29 09:44:58 -04:00
compose.yml Remove PostgREST (#41299) 2025-10-27 13:27:59 -04:00
CONTRIBUTING.md Screenshot testing (#45259) 2026-01-05 16:34:36 -05:00
debug.plist
default.nix Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
docker-compose.sql
Dockerfile-collab Bump Rust version to 1.92 (#44649) 2025-12-17 01:42:04 +01:00
Dockerfile-collab.dockerignore
Dockerfile-cross.dockerignore Add remote server cross compilation (#19136) 2024-10-12 23:23:56 -07:00
Dockerfile-distros Support More Linux (#18480) 2024-09-30 17:46:21 -04:00
Dockerfile-distros.dockerignore Support More Linux (#18480) 2024-09-30 17:46:21 -04:00
flake.lock Bump Rust version to 1.92 (#44649) 2025-12-17 01:42:04 +01:00
flake.nix nix: Resolve 'hostPlatform' rename warning in dev shell (#45045) 2025-12-16 15:57:26 -08:00
GEMINI.md Add missing GEMINI.md rule file for gemini-cli (#38885) 2025-10-02 09:47:29 -04:00
LICENSE-AGPL Update license year (#24191) 2025-02-04 09:02:59 -05:00
LICENSE-APACHE Update license year (#24191) 2025-02-04 09:02:59 -05:00
LICENSE-GPL
livekit.yaml
lychee.toml ci: Check for broken links (#30844) 2025-06-06 09:39:35 +00:00
Procfile Update instructions for local collaboration (#35689) 2025-08-06 11:10:28 -07:00
Procfile.all Add agent thread sharing (#46140) 2026-01-06 12:49:51 -08:00
Procfile.web Remove PostgREST (#41299) 2025-10-27 13:27:59 -04:00
README.md docs: Remove local collaboration docs (#45301) 2025-12-18 21:42:28 +00:00
renovate.json Remove workspace-hack (#40216) 2025-10-17 18:58:14 +00:00
REVIEWERS.conl Fix Yara's GitHub handle (#45095) 2025-12-17 12:06:46 +00:00
rust-toolchain.toml Bump Rust version to 1.92 (#44649) 2025-12-17 01:42:04 +01:00
shell.nix Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
typos.toml Add ep split-commit command (#46067) 2026-01-05 13:13:46 +02:00

Zed

Zed CI

Welcome to Zed, a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.


Installation

On macOS, Linux, and Windows you can download Zed directly or install Zed via your local package manager (macOS/Linux/Windows).

Other platforms are not yet available:

Developing Zed

Contributing

See CONTRIBUTING.md for ways you can contribute to Zed.

Also... we're hiring! Check out our jobs page for open roles.

Licensing

License information for third party dependencies must be correctly provided for CI to pass.

We use cargo-about to automatically comply with open source licenses. If CI is failing, check the following:

  • Is it showing a no license specified error for a crate you've created? If so, add publish = false under [package] in your crate's Cargo.toml.
  • Is the error failed to satisfy license requirements for a dependency? If so, first determine what license the project has and whether this system is sufficient to comply with this license's requirements. If you're unsure, ask a lawyer. Once you've verified that this system is acceptable add the license's SPDX identifier to the accepted array in script/licenses/zed-licenses.toml.
  • Is cargo-about unable to find the license for a dependency? If so, add a clarification field at the end of script/licenses/zed-licenses.toml, as specified in the cargo-about book.