Files
zed/crates/git_ui/Cargo.toml
T
Luca Zani de56a8fd82 git_ui: Strip ANSI escape codes from git command output (#53444)
When git commands (push, pull, hooks...) produce output containing ANSI
escape sequences for colors or formatting, Zed was displaying them as
raw escape codes in the output buffer, making the output hard to read.
This simply escapes ANSI from the git output

### Before and After

  <table>
    <tr>
      <th align="center">Before</th>
<th align="center">After</th>
    </tr>
    <tr>
  <td>
<img width="882" height="862" alt="Screenshot 2026-04-08 at 21 13 07"
src="https://github.com/user-attachments/assets/58731e80-d864-47ca-8983-d0e86e924843"
/>
</td>
      <td>
<img width="882" height="862" alt="Screenshot 2026-04-08 at 21 15 14"
src="https://github.com/user-attachments/assets/7649200a-2d82-4442-88da-e231304911a8"
/>
</td>
    </tr>         
  </table>        

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Related to #43817. This PR only addresses the escaping of the ANSI
codes; colors and other stuff are not handled

Release Notes:

- Fixed ANSI escape codes being displayed as raw text in git command
output
2026-04-09 07:21:54 +00:00

90 lines
2.2 KiB
TOML

[package]
name = "git_ui"
version = "0.1.0"
edition.workspace = true
publish.workspace = true
license = "GPL-3.0-or-later"
[lints]
workspace = true
[lib]
name = "git_ui"
path = "src/git_ui.rs"
[features]
test-support = ["multi_buffer/test-support", "remote_connection/test-support"]
[dependencies]
agent_settings.workspace = true
alacritty_terminal.workspace = true
anyhow.workspace = true
askpass.workspace = true
buffer_diff.workspace = true
call.workspace = true
collections.workspace = true
component.workspace = true
db.workspace = true
editor.workspace = true
file_icons.workspace = true
futures.workspace = true
fuzzy.workspace = true
git.workspace = true
gpui.workspace = true
itertools.workspace = true
language.workspace = true
language_model.workspace = true
linkify.workspace = true
log.workspace = true
markdown.workspace = true
menu.workspace = true
multi_buffer.workspace = true
notifications.workspace = true
panel.workspace = true
picker.workspace = true
project.workspace = true
prompt_store.workspace = true
proto.workspace = true
remote_connection.workspace = true
remote.workspace = true
schemars.workspace = true
serde.workspace = true
serde_json.workspace = true
settings.workspace = true
smallvec.workspace = true
smol.workspace = true
strum.workspace = true
telemetry.workspace = true
theme.workspace = true
theme_settings.workspace = true
time.workspace = true
time_format.workspace = true
ui.workspace = true
ui_input.workspace = true
util.workspace = true
watch.workspace = true
workspace.workspace = true
zed_actions.workspace = true
zeroize.workspace = true
ztracing.workspace = true
tracing.workspace = true
[target.'cfg(windows)'.dependencies]
windows.workspace = true
[dev-dependencies]
ctor.workspace = true
editor = { workspace = true, features = ["test-support"] }
gpui = { workspace = true, features = ["test-support"] }
indoc.workspace = true
pretty_assertions.workspace = true
project = { workspace = true, features = ["test-support"] }
rand.workspace = true
settings = { workspace = true, features = ["test-support"] }
unindent.workspace = true
workspace = { workspace = true, features = ["test-support"] }
zlog.workspace = true
remote_connection = { workspace = true, features = ["test-support"] }
[package.metadata.cargo-machete]
ignored = ["tracing"]