zimfw / utility

Utility aliases and functions. Adds colour to ls, grep and less.
MIT License
13 stars 9 forks source link

NO_COLOR being applied to visual studio code when started from the dock #2

Closed LostKobrakai closed 5 months ago

LostKobrakai commented 2 years ago

Describe the bug
NO_COLOR being set in unintended case.

Steps to reproduce
The fist 4 steps restart the shell with a clean installation of Zim in a temporary directory. Use exec zsh when restarting the terminal or restarting the shell is needed.

  1. Start Visual Studio code from the Dock
  2. echo $NO_COLOR yields 1

Uncommenting the following line yields empty on the last step: https://github.com/zimfw/utility/blob/ca25027097339fb1539224936c9fbb29914c56e2/init.zsh#L78

Current behavior
Opening Visual Studio Code from the Dock results in NO_COLOR being set, which is inherited by the built in terminal.

Expected behavior
Opening applications from the Dock should not yield a NO_COLOR context unintentionally.

Screenshots
If applicable, add screenshots to help explain your problem.

zimfw info

zimfw version: 1.9.0 (built at 2022-05-09 23:35:03 UTC, previous commit is 741bb78)
ZIM_HOME:      /Users/benni/.zim
Zsh version:   5.8
System info:   Darwin Lillith.fritz.box 21.2.0 Darwin Kernel Version 21.2.0: Sun Nov 28 20:29:10 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T8101 arm64

Additional context
Add any other context about the problem here.

ericbn commented 2 years ago

Hi @LostKobrakai. Does adding the following line to the above line 56 of utility/init.zsh help?

zmodload -F zsh/terminfo +p:terminfo
LostKobrakai commented 2 years ago

I doesn't seem to help. I also tried to echo a bunch of values, but terminfo[colors] actually returns 256 and doesn't set NO_COLOR when starting a terminal within vscode itself. The terminal seems to inherit NO_COLOR from an app wide context – at least that's the best idea I have at explaining this.

When I start vscode from a terminal – instead of the dock – using code … I don't see NO_COLOR being set.

kissge commented 2 years ago

I'm having same experience. I'm not sure if this issue is related to zimfw/utility, but at least for me, setting this in VSCode settings.json is an effective workaround.

"terminal.integrated.env.osx": {
  "NO_COLOR": null
},
yamcodes commented 8 months ago

I'm having same experience. I'm not sure if this issue is related to zimfw/utility, but at least for me, setting this in VSCode settings.json is an effective workaround.

"terminal.integrated.env.osx": {
  "NO_COLOR": null
},

I love you