Summary
This PR adds the ability to quote terminal selections into Agent
threads, similar to how editor selections can be quoted. Users can now
select text in the terminal and add it as context to their agent
conversation.
### Features
- **Context menu**: Added "Add to Agent Thread" option to the terminal's
right-click menu (only shows when text is selected)
- **Keyboard shortcut**: The existing `cmd->` / `ctrl->` shortcut now
works in the terminal
- **Collapsed display**: Terminal output appears as a collapsed
"Terminal" crease in the chat, just like code references
- **Works with both thread types**: Supports both ACP-style threads
(Claude Code) and text threads
### Implementation
- Extended `quote_selection` handler to check for terminal panel focus
after checking for editor selections
- Terminal content is formatted as ` ```terminal` code blocks via new
`insert_terminal_crease` method
- Refactored crease insertion into `insert_crease_impl` helper to
support both code snippets (with `TextSnippet` icon) and terminal output
(with `Terminal` icon)
- Added automatic detection and folding of ` ```terminal` blocks in
`set_message` so terminal content stays collapsed in sent message
history
- Terminal creases use a trailing space instead of newline so cursor
behavior matches user expectations
### Demo
1. Select text in terminal
2. Right-click → "Add to Agent Thread" (or press `cmd->`)
3. Terminal content appears as collapsed "Terminal" block in chat
4. Send message - AI receives full terminal output, but chat history
shows it collapsed
### General note
I'm new to open source and the codebase in general so let me know if
anything should be different!
I tried to stay in line with other patterns I saw.
I didn't see a way to setup an end to end test with a real terminal so I
just added a unit test for the adding of the text to the chat, if it
exists and I missed it then I think the test coverage could be improved
with a test that uses a real terminal + running the command
<img width="431" height="148" alt="image"
src="https://github.com/user-attachments/assets/854732f9-2a7f-4f31-867e-d54af068c97c"
/>
Release Notes:
- agent: Added the ability to send selections from terminals into the
Agent thread
---------
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Add the icon to the left side of the message editor, add a new icon for
when the thinking mode is toggled on, and add a keybinding for the
action. Currently available under a feature flag-only but should be out
soon.
<img width="400" height="318" alt="Screenshot 2026-01-29 at 11 57@2x"
src="https://github.com/user-attachments/assets/e033ec83-746b-4fed-beb7-ed26e96cb60a"
/>
Release Notes:
- N/A
## Summary
This PR extends the `always_allow` tool permission patterns to work with
Nushell, Elvish, and Rc shells. Previously, these shells were
incorrectly excluded because they don't use `&&`/`||` operators for
command chaining. However, brush-parser can safely parse their command
syntax since they all use `;` for sequential execution.
## Changes
- Add `ShellKind::Nushell`, `ShellKind::Elvish`, and `ShellKind::Rc` to
`supports_posix_chaining()`
- Split `ShellKind::Unknown` into `ShellKind::UnknownWindows` and
`ShellKind::UnknownUnix` to preserve platform-specific fallback behavior
while still denying `always_allow` patterns for unrecognized shells
- Add comprehensive tests for the new shell support
- Clarify documentation about shell compatibility
## Shell Notes
- **Nushell**: Uses `;` for sequential execution. The `and`/`or`
keywords are boolean operators on values, not command chaining.
- **Elvish**: Uses `;` to separate pipelines. Does not have `&&` or `||`
operators. Its `and`/`or` are special commands operating on values.
- **Rc (Plan 9)**: Uses `;` for sequential execution and `|` for piping.
Does not have `&&`/`||` operators.
## Security
Unknown shells still return `false` from `supports_posix_chaining()`, so
`always_allow` patterns are denied for safety when we can't verify the
shell's syntax.
(No release notes because granular tool permissions are still
feature-flagged.)
Release Notes:
- N/A
---------
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
- Fix sticky buffer header being painted on top of the toolbar
- Fix buffer header click handlers and tooltips sometimes not working
(element ID collision issue)
- Deduplicate buffer header rendering code between split and normal
editors
Release Notes:
- N/A
Thanks @injust for pointing this out. It seems a few other action docs
were also copied from elsewhere and weren't updated to reflect their
actual purpose. This PR fixes those, though I may not have covered all
of them.
Closes#46832
Release Notes:
- N/A
---------
Co-authored-by: Kunall Banerjee <hey@kimchiii.space>
GitHub allows defining a default shell for all jobs on the workflow
level, which we did not use before, yet practically did when it comes
down to our usage of `named::bash`. Since this makes stuff quite
verbose, I decided on using the defaults instead so the workflows become
somewhat easier to audit when reading the generated files.
Powershell steps continue to use Powershell, only the default for bash
scripts was modified.
Release Notes:
- N/A
<img width="1110" height="280" alt="Screenshot 2026-01-28 at 3 35 52 PM"
src="https://github.com/user-attachments/assets/4d467e2c-2e7b-4ec7-bc87-6f0df8e667f0"
/>
<img width="1094" height="411" alt="Screenshot 2026-01-28 at 3 40 54 PM"
src="https://github.com/user-attachments/assets/f559df93-e72e-4457-ba1b-f7d6239f3285"
/>
Previously, if a user configured `^ls` as an always-allow pattern, an
attacker could craft a command like `ls && rm -rf /` which would be
auto-approved because the regex only matched the beginning of the
command string.
Now the command is parsed into individual sub-commands (`ls`, `rm -rf
/`) and EACH sub-command must match an allow pattern for auto-approval.
This prevents shell injection attacks using operators like:
- `&&` and `||` (boolean operators)
- `;` and `&` (sequential/background execution)
- `|` (pipes)
- Newlines
- Command substitution (`$()` and backticks)
- Process substitution (`<()` and `>()`)
## Matching Logic
- **always_deny**: if ANY sub-command matches, deny the entire command
- **always_confirm**: if ANY sub-command matches, require confirmation
(unless always_deny matched, in which case deny)
- **always_allow**: ALL sub-commands must match for auto-approval
(unless always_confirm or always_deny matched, in which case defer to
those)
- If parsing fails, or if the shell is unsupported, then always_allow is
disabled for this command
As usual, `always_allow_tool_actions` supercedes all of these. If it is
`true`, then we always allow all tool calls, no questions asked.
## Shell Compatibility
The shell parser only supports POSIX-like command chaining syntax (`&&`,
`||`, `;`, `|`).
**Supported shells:** Posix (sh, bash, dash, zsh), Fish 3.0+, PowerShell
7+/Pwsh, Cmd, Xonsh, Csh, Tcsh
**Unsupported shells:** Nushell (uses `and`/`or` keywords), Elvish (uses
`and`/`or` keywords), Rc (Plan 9 shell - no `&&`/`||` operators)
For unsupported shells:
- The "Always allow" UI options are hidden for the terminal tool
- If the user has `always_allow` patterns configured in settings, they
will see a `Deny` with an explanatory error message
(No release notes because granular tool permissions are behind a feature
flag.)
Release Notes:
- N/A
---------
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
Previously, each Agent panel created its own `ThreadStore` instance, so
thread history updates wouldn't sync between open windows. Users had to
close and reopen windows to see threads created in other windows.
Now `ThreadStore` is initialized once as a global and shared across all
windows. When any window saves a thread, ThreadStore::reload() calls
cx.notify(), which notifies all NativeAgentSessionList observers,
causing all windows' history views to refresh.
Note: This only works for the native Zed agent. It also is only
improving the history view (thread titles)—this PR does not sync edits
between multiple windows when the same thread is open in each.
Release Notes:
- Improved Zed agent thread history to update across all open windows
Brought the Markdown output up to date with how Markdown is used in the
Agent panel. This fixed an issue with outputs that were too large for
the execution view as well as made sure that markdown would wrap.
<img width="3222" height="2334" alt="image"
src="https://github.com/user-attachments/assets/c65efa53-b792-4529-909a-9117053e30be"
/>
Release Notes:
- N/A
Closes #ISSUE
Store `ReleaseChannel` instead of `&'static str`. This allows displaying
other aspects about the channel than just the display name. Makes it
more concrete what is stored within the field, as it has limited
variants, as opposed to something like `session_id`
Release Notes:
- N/A *or* Added/Fixed/Improved ...
The inline git blame always calculated the difference in years for
commits based solely upon the difference between the years and not
actual time passed. This is currently somewhat unfortunate during
January, as for all dates starting from 2024 and lower, we would show `2
years ago`, even if the date was the 31st of December 2024.
This fixes/improves this to use the lower bound always instead, as I
find this much more intuitive - we can probably look into even better
formatting here at some other point.
Release Notes:
- Fixed an issue where relative time deltas would sometimes show as `n +
1 years` instead of the actual `n years`.
Closes #ISSUE
Make `ProtoConversion::to_proto` consume `self`. We never create more
than one `proto` type out of a single `dap` type, meaning having the
conversation be non-consuming has no benefits, while consuming allows us
to remove a bunch of clones.
Release Notes:
- N/A *or* Added/Fixed/Improved ...
I'm used to having the Emacs mark-sexp command, which selects/extends
the selection to the start or end of a sexp/larger syntax node, so when
I found out the `move to {start,end} of larger syntax node` commands
were added, these seemed like a natural addition; especially since most
other commands in Zed seem to have movement and selection pairs, but
those didn't really feel like they did.
I did a really *lot* of tests (brainstormed ideas with GLM 4.7, then
wrote the actual test case strings myself, then had it convert them to
Rust, then made sure the tests made sense and passed), I'm not sure if
it's too much or too little, but I looked at the PR that added the `move
to` versions of these commands and it was also +~550 lines, so this
seemed in the ballpark 😅
I factored out the core syntax node finding logic from those commands
into a common function, so that both sets of commands could use it, just
with different code for modifying the editor state wrapped around — mine
just moves each selection's head, instead of totally resetting it.
Release Notes:
- Added commands for extending selections to syntax node boundaries.
i.e. `editor: select to start of larger syntax node` and `editor: select
to end of larger syntax node`.
Basically just replaced `SharedString::new("` with
`SharedShring::new_static("` which removes the allocation to `Arc<str>`.
Unfortunately this can't be enforced at compile time without trait
specialization which is only available on nightly. You could assert that
`TypeId`'s differ, but `TypeId` only exists at runtime.
Release Notes:
- N/A *or* Added/Fixed/Improved ...
When working in a workspace with multiple repositories, the git panel
provides a repository picker to switch between them. However, there was
no visual indication of which repositories have uncommitted changes:
users had to either select each repository individually or check the
project panel where modified directories are highlighted.
This change adds git status icons to the repository picker, allowing
users to see at a glance which repositories contain changes (modified,
added, deleted, or conflicted files). The icons use the same visual
language already established for file status throughout the git panel.
Additionally, the repository picker now matches the branch picker's
styling for visual consistency:
- Added "Repositories" header
- Aligned popover width and positioning
- Added scrollbar
- Added check icon next to currently selected repo
- Added selected branch under repo list item
- Sort by display name is now case insensitive
Before:
<img width="1200" height="815" alt="Screenshot 2026-01-27 at 11 43 55"
src="https://github.com/user-attachments/assets/12c1008b-4724-44bf-80c9-e9ad97755090"
/>
After:
<img width="1761" height="1196" alt="Screenshot 2026-01-27 at 14 07 52"
src="https://github.com/user-attachments/assets/cd778f42-ade0-4da0-9732-2d8631c04124"
/>
Branch picker for style reference:
<img width="1200" height="815" alt="Screenshot 2026-01-27 at 11 44 03"
src="https://github.com/user-attachments/assets/369b0d29-8fed-4293-98c2-52c2d780fe9a"
/>
Release Notes:
- Git: Improved the project picker in the panel by also displaying the
GIt status icon on them, to clearly indicate which repos have changes.
---------
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
This PR adds a check during extension compilation to ensure that every
compiled extension provides at least one feature, as otherwise, the
extension is useless to have.
With this in, compiling an extension that does not provide anything will
fail.
Release Notes:
- N/A
This PR adds the upsell banner for built-in agents in the ACP registry
page, meaning: if you search for Claude Code, Codex, or Gemini, we'll
display a banner communicating they're already available in Zed. This
may change one day, though, whenever we rely on their registry
implementation. I'm also removing the beta chip from the page here.
Release Notes:
- N/A
Previously, double-click word selection in markdown used simple
space-based boundaries, so `foo.bar()` would be selected as a single
word.
Now we use `CharClassifier` which properly handles word boundaries:
- **Regular markdown text**: Punctuation (`.`, `(`, `)`, etc.) now acts
as word boundaries. Double-clicking on `foo.bar()` selects just `foo` or
`bar`.
- **Code blocks**: Uses the language's word characters. For example, in
JavaScript, `$foo` and `#bar` are selected as whole words since `$` and
`#` are configured as word characters.
Release Notes:
- Improved double-click word selection in Agent Panel to respect
punctuation and language-specific word characters.
`LanguageServerSeed` is used as a key to identify language servers.
Previously, it included the entire `LspSettings`, which meant that
changing `lsp.<server>.settings` (dynamic configuration) would cause the
server to restart unnecessarily.
Dynamic settings can be updated via LSP's
`workspace/didChangeConfiguration` notification without requiring a
server restart. Only `binary` and `initialization_options` should be
part of the server identity, as changes to these genuinely require
restarting the server.
This is a follow-up fix to #35270 which introduced `LanguageServerSeed`
but inadvertently included dynamic settings in the server identity
(although I remember that this dynamic settings reflection stopped
working pretty recently, so there might be other commits besides #35270
that changed the behavior of `LanguageServerSeed`)
Closes #ISSUE
Release Notes:
- Fixed language servers unnecessarily restarting when changing
`lsp.<server>.settings` configuration. Dynamic settings are now properly
updated via `workspace/didChangeConfiguration` without requiring a
server restart.
## Summary
Adds three syntax highlighting captures that are used across multiple
language definitions but were missing from the documentation table in
`docs/src/extensions/languages.md`.
## Added Captures
| Capture | Used In |
|---------|---------|
| `@constant.builtin` | C, Go, C++, YAML, TSX |
| `@type.builtin` | C++, Python, Rust, JavaScript, TSX |
| `@variable.parameter` | TypeScript, JavaScript, Python, Rust, TSX,
Diff |
## Context
While working on a [PR to add named argument highlighting to the PHP
extension](https://github.com/zed-extensions/php/pull/95), I initially
used `@label` because the documentation didn't list
`@variable.parameter`. A reviewer pointed out that `@variable.parameter`
is actually supported and preferred - the docs were just outdated.
This PR fixes that documentation gap.
Release Notes:
- N/A
This setting brings Zed in parity with Sublime's `bold_folder_labels`.
The settings does just that, it makes directory labels bold. This
setting is
particularly useful for those who turn icons off, but do need a visual
queue (besides the chevron) to quickly tell apart files and folders.
Note: This PR depends on
https://github.com/zed-industries/zed/pull/47629.
Otherwise, the setting will appear to have no uneffect (unless you're
using a custom UI font). ZedSans has "bold" today, but that's too thick
for the project panel.
<img width="2282" height="1545" alt="zed-project-panel"
src="https://github.com/user-attachments/assets/63ccacc0-c00a-48b2-8e70-923aa6717956"
/>
Release Notes:
- Added `project_panel.bold_folder_labels` to show folder names with
bold text in the project panel (defaults to `false`).