Open kfkonrad opened 6 days ago
The sequences stem from delta's background/foregreound color detection. The weird output is the terminal's response which you should normally not see.
You can disable the automatic detection by explicitly specifying --dark
/ --light
(or dark = true
/ light = true
in the config file)
See https://dandavison.github.io/delta/choosing-colors-styles.html for details.
What version of VSCode are you running? Is delta also quite slow by any chance?
I can confirm using the --dark
or --light
flag or respective config also prevents the weird output
I'm on the latest VS Code version: 1.90.2
delta isn't slow, not that I could tell anyway.
Unfortunately I can't reproduce this on my own mac or @janhohenheim's mac with VSCode 1.90.2 and delta 0.17.0.
Follow-up questions:
terminal.integrated
)?I came up with a list of things that you could try to help figure out why this happens if you're up for it 😃
printf '\e]10;?\e\\' && printf '\e]11;?\e\\' && printf '\e[c' && cat -v
# ^^^^^^^^^^^^^ ^^^^^^^^^^^^^ ^^^^
# ask for the fg color ask for the bg color ask for some basic info
theme
example from terminal-colorsaurus
(only if you're comfortable running code from outside this repo).Note that we are both running Intel macs. I don't expect this to make a difference, but I've seen very weird issues come from different architectures in the past.
I can't replicate the bug anymore. I don't know what changed about my system because I don't recall running updates in the last two days. I'm sorry if that means I/we pinpoint the error further if/when it reappears elsewhere.
Here's the answers to your questions in case that's still relevant:
I don't use a multiplexer and my delta config is as follows:
[delta]
navigate = true # use n and N to move between diff sections
hunk-header-decoration-style = yellow box
hyperlinks = true
hyperlinks-file-link-format = "vscode://file/{path}:{line}"
# delta detects terminal colors automatically; set one of these to disable auto-detection
# dark = true
# light = true
I'm not sure which parts of my VS Code settings are relevant so here's everything starting with terminal.integrated
:
"terminal.integrated.fontSize": 14,
"terminal.integrated.experimentalImageSupport": true,
"terminal.integrated.tabs.enabled": true,
"terminal.integrated.sendKeybindingsToShell": true,
"terminal.integrated.defaultProfile.windows": "Git Bash",
"terminal.integrated.scrollback": 1000000,
"terminal.integrated.enableMultiLinePasteWarning": false,
"terminal.integrated.shellIntegration.decorationsEnabled": "never",
"terminal.integrated.shellIntegration.enabled": false,
"terminal.integrated.gpuAcceleration": "on"
I tried compiling the version on your branch @bash and it worked fine (just like 0.16.5 and 0.17.0 do now).
The output of your printf-Snippet is ^[]10;rgb:cccc/cccc/cccc^[\^[]11;rgb:1818/1818/1818^[\^[[?1;2c
.
I also ran your example program and its output is dark, fg: 82, bg: 8
@kfkonrad Thank you so much for working through my pinpoint steps 💛 I'll try to apply your settings, maybe I'll find a way to reproduce it on my machine.
I can't replicate the bug anymore. [..] I'm sorry if that means I/we pinpoint the error further if/when it reappears elsewhere.
No worries :) Let me know if the issue reappears.
When running delta version 0.17.0 on a terminal in VS Code I get the following ouput:
Running delta in another terminal emulator such as iTerm or Terminal on my Mac yields the desired output. Due to this buggy ouput delta 0.17.0 is unusable on VS Code right now, at least on my machine.
I also did a
cargo build --release
to verify that the bug is still in the code base on main as of commit id f5b3717. The bug also comes up using zsh and fish as the shell btwThe bug does not occur with 0.16.5 so my quickfix for the meantime is to just use this older version.