-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
garbage outputted in console? #8497
Comments
Looks like an escape sequence representing cursor movement 🤔 |
Interesting. I don't know much about this kind of stuff. I edited the issue title. |
I'm seeing the same and was about to open a new issue when I found this one. To reproduce:
Observed: Expected (and what Alacritty shows): Zed info:
|
Same problem occurred. Even not showing git diff.
|
For anyone having these symptoms and having |
This didn't help me, unfortunately, but completely removing EDIT: ohh, actually what helped was adding |
Thanks! It works for me! |
Do these fixes suggested only apply to I'm confused on why this is happening. I don't know a lot about terminal emulators. How is it possible that something can put text in the input field? And why would it be a color code? |
No, seems to be happenin with other CLI tools (e.g., #9742) |
For me this happens with lefthook. Especially annoying on its |
Hi, author of terminal-colorsaurus (the library that delta uses for color detection) here 👋🏼 The The output appears because Zed however replies to color queries out of order. For example when sending $ printf '\e]11;?\e\\ \e[c' && cat -v
^[[?6c^[]11;rgb:dcdc/dcdc/dddd^[\^C (edit: my printf was incorrect, but my conclusion was nevertheless correct ^^) |
delta user, and use delta as git diff tool. I got this too.
|
Partially addresses #8497 (namely, the occurring with `delta`) As I mentioned in #8497 (comment), zed currently replies to OSC color requests (`OSC 10`, `OSC 11`, ...) out of order when immediately followed by another request (for example `CSI c`). All other terminals that [I have tested](https://github.com/bash/terminal-colorsaurus/blob/main/doc/terminal-survey.md) maintain relative order when replying to requests. ## Solution Respond to the `ColorRequest` in `process_event` (in the same place where other PTY writes happen) instead of queuing it up in the internal event queue. ## Alternative I initially thought that I could handle the color request similarly to the `TextAreaSizeRequest` where the size is stored in `last_content` and updated on `sync`. However this causes the terminal to report out-of-date values when a "set color" sequence is followed by a color request. ## Tests 1. `OSC 11; ?` (request bg color) + `CSI c` (request device attributes): ```shell printf '\e]11;?\e\\ \e[c' && cat -v # Expected result: ^[]11;rgb:dcdc/dcdc/dddd^[\^[[?6c # Current result: ^[[?6c^[]11;rgb:dcdc/dcdc/dddd^[\ (❌) # Result with this PR: ^[]11;rgb:dcdc/dcdc/dddd^[\^[[?6c (✅) # Result with alternative: ^[]11;rgb:dcdc/dcdc/dddd^[\^[[?6c (✅) ``` 2. `OSC 11; rgb:f0f0/f0f0/f0f0` (set bg color) + `OSC 11; ?` (request bg color) ```shell printf '\e]11;rgb:f0f0/f0f0/f0f0\e\\ \e]11;?\e\\' && cat -v # Expected result: ^[]11;rgb:f0f0/f0f0/f0f0^[\ # Current result: ^[]11;rgb:f0f0/f0f0/f0f0^[\ (✅) # Result with this PR: ^[]11;rgb:f0f0/f0f0/f0f0^[\ (✅) # Result with alternative: ^[]11;rgb:OUT_OF_DATE_COLOR_HERE^[\ (❌) ``` Release Notes: - N/A
This is also happening for me on repos that use lefthook. |
Fingers crossed for #15105 (comment) to be true. |
I also was able to fix it by just updating Lefthook, so it must be some weird combination of two issues? |
for me its fix in v0.151.0-pre |
FWIW I no longer seem to be experiencing this issue, I also think the fix might have been two-fold, both a Zed update and a Lefthook update. |
I'm still experiencing this issue, but not with Lefthook. I just had it happen the other day, but I can't remember what program it was. I'll report back once I find out |
I am no longer able to reproduce this issue. If you are seeing this with a current version of Zed please reply with your zed version and steps to reproduce and I'm happy to reopen. Thanks all! |
Check for existing issues
Describe the bug / provide steps to reproduce it
I'm having an issue with some commands where, what I believe to be are color codes are being spat into the output.
This issue is not occurring with the built in Terminal.
I'm not 100% sure if this is due to Zed so I think this might need some further investigation, but I'm assuming it might be because of it being a non issue with other terminals?
Environment
Zed: v0.124.6 (Zed Preview)
OS: macOS 14.3.1
Memory: 32 GiB
Architecture: aarch64
If applicable, add mockups / screenshots to help explain present your vision of the feature
If applicable, attach your
~/Library/Logs/Zed/Zed.log
file to this issue.If you only need the most recent lines, you can run the
zed: open log
command palette action to see the last 1000.No response
The text was updated successfully, but these errors were encountered: