Skip to content
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

Weird background on some text #256

Open
saneef opened this issue Dec 9, 2020 · 17 comments
Open

Weird background on some text #256

saneef opened this issue Dec 9, 2020 · 17 comments

Comments

@saneef
Copy link
Contributor

saneef commented Dec 9, 2020

I'm using Fish shell with Terminus. Within Terminus some text comes with weird background color, especially auto suggestions in fish.

Screenshot 2020-12-09 at 2 36 19 PM

Looks like it is similar to the 'Terminal panel background issue' in the README, but I'm not using DA UI.

Is there any fix for this on Terminus, or Fish shell side?

@randy3k
Copy link
Owner

randy3k commented Dec 9, 2020

How did you set the TERM variable?

@randy3k
Copy link
Owner

randy3k commented Dec 9, 2020

By the way, what themes are you using in ST and Terminus?

@saneef
Copy link
Contributor Author

saneef commented Dec 9, 2020

Theme for Terminus

I'm manually setting variables in Terminus settings. Because, choosing theme from Terminus don't change the background color. It stays as a dark color always. 😢 I tried restarting like mentioned in #230; no luck.

{
  "256color": false,
  "theme": "default",
  "unix_term": "xterm-256color",
  "user_theme_colors": {
    "background": "#fdf6e3",
    "black": "#002831",
    "blue": "#2176c7",
    "brown": "#a57706",
    "caret": "#9cc2c3",
    "cyan": "#259286",
    "foreground": "#657b83",
    "green": "#6cbe6c",
    "light_black": "#006488",
    "light_blue": "#178ec8",
    "light_brown": "#b27e28",
    "light_cyan": "#00b39e",
    "light_green": "#51ef84",
    "light_magenta": "#e24d8e",
    "light_red": "#f5163b",
    "light_white": "#fcf4dc",
    "magenta": "#c61c6f",
    "red": "#d11c24",
    "white": "#eae3cb"
  }
}

ST

Theme

Using "Default"

Screenshot 2020-12-10 at 1 52 16 AM

Color Scheme

Solarized (light), slightly modified.

@saneef
Copy link
Contributor Author

saneef commented Dec 9, 2020

@randy3k Sorry, It was my mistake.

{
  "256color": false, // 😔 was setting to 'false' instead of 'true'
  ...
}

Changing to true fixed the problem.

Also, the background problem, I mentioned above, vanished too. I changed ST Color Scheme and Theme to another one, then set theme back to the one I use. No idea what exactly was the problem.

@saneef saneef closed this as completed Dec 9, 2020
@saneef
Copy link
Contributor Author

saneef commented Dec 9, 2020

I could reproduce the above problem even with { "256color": true, "unix_term": "xterm-256color", ...}. I'm using Sublime Text 3 on macOS.

  1. Problem appears when launched from terminal (iTerm2) using subl or subl <path>.
  2. Works fine when Sublime Text is launched using "Sublime Text.app" from finder or spotlight.

@saneef saneef reopened this Dec 9, 2020
@saneef
Copy link
Contributor Author

saneef commented Dec 10, 2020

I suspect this is due to the difference value in TERM variable.

Launched using subl from terminal

From Sublime Console:

>>> import os
>>> os.popen('echo $TERM').read()
'xterm-256color\n'

Launched using 'Sublime Text.app'

>>> import os
>>> os.popen('echo $TERM').read()
'dumb\n'

@randy3k
Copy link
Owner

randy3k commented Dec 10, 2020

you also need to edit the setting unix_term in the settings.

@randy3k
Copy link
Owner

randy3k commented Dec 10, 2020

You shouldn't just inspect the $TERM variable in the Sublime Console. Try printing the $TERM variable in your shell.

echo $TERM

@saneef
Copy link
Contributor Author

saneef commented Dec 10, 2020

$ echo $TERM                                                                                                                                                
xterm-256color

@saneef
Copy link
Contributor Author

saneef commented Dec 10, 2020

you also need to edit the setting unix_term in the settings.

This is how I have configured.

{
	"256color": true,
	"theme": "user",
	"unix_term": "xterm-256color",
	"user_theme_colors":
	{
		...
	}
}

@randy3k
Copy link
Owner

randy3k commented Dec 10, 2020

$ echo $TERM                                                                                                                                                
xterm-256color

Even when you launched Sublime Text directly?

@saneef
Copy link
Contributor Author

saneef commented Dec 10, 2020

Yes, in both cases it is xterm-256color

@psychedelicious
Copy link

psychedelicious commented Dec 21, 2021

I just ran into this issue or something like it while using the Monokai Pro ST Theme, Color Scheme, and Terminus theme. I have ..."256color": true, "unix_term": "xterm-256color"... in my Terminus user settings, and echo $TERM -> xterm-256color.

Screen Shot 2021-12-21 at 10 00 24 pm

As far as I can tell, Terminus is only applying the correct background colour from the Terminus theme to characters which have a color != foreground. All other characters and space in the terminal have the ST theme's background PNG texture.

I copied the Monokai Pro theme to the Terminus user settings, set my theme to user, and then set "background": "rgba(0, 0, 0, 0)". Now at least the background colours are consistent (though not correct).

Edit: I think that setting the RGBA value doesn't actually work, it just causes some problem and the background colour isn't parsed correctly. So instead, I've just set background to be the same colour as the ST theme's PNG texture.

Any suggestions to get the correct background colour? Thanks.

@randy3k
Copy link
Owner

randy3k commented Dec 21, 2021

See this bug sublimehq/sublime_text#817
Terminus has a workaround for web color

# There is a bug/feature of add_regions

@benfrain
Copy link

I'm seeing the same issue (I think). Also using Monokai Pro, p10k. Have this in my settings:

{
	"256color": true,
	"unix_term": "xterm-256color",
}

Little unclear from @randy3k last comment - is there something I can change to get the backgrounds consistent?

@PatTheMav
Copy link

As a small heads-up for those that use base16-shell or similar methods to set an extended colour-range in their terminals, it seems that Terminus does not support setting colours this way.

base16-shell sets 8 base colours, sets the bright variant to the same values and adds another 6 colours as "accent" colours, which can then be picked up by e.g. vim.

Without this, the accent colours are set in the "bright" colour range between bright black and bright white, but then obviously require base16 colour schemes that are aware of that (i.e. vim themes can work with both variants).

Even setting 256color to true and unix_term to xterm-256color seems to result in default ANSI-colours being used (which are then transformed into colours from the current Sublime theme), any colour "outside" this range yields unexpected results (in my case, bold characters in the "accent" colour range get a white background instead).

@anks2k
Copy link

anks2k commented Jun 1, 2024

So all this for nothing, I was able to rectify this issue after several tries with

{
    "color_scheme_tint": "",
    "class": "text_output_control"
}

This is a rule in the Theme Settings file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants