randy3k / Terminus

Bring a real terminal to Sublime Text
https://packagecontrol.io/packages/Terminus
MIT License
1.39k stars 81 forks source link

user_light_theme_colors and user_dark_theme_colors not working #361

Open pelemarse opened 2 years ago

pelemarse commented 2 years ago

Hi, This changes for my not working 192870b

Sublime Text 4 (4134) MacOS 12.4 Terminus 0.3.27)

Code in file theme.py:70

current_style = sublime.ui_info()['theme']['style']

should return a 'dark' or 'light' score but return a 'system' to me. I guess this place should be like this:

current_style = sublime.ui_info()['system']['style']

@timfjord

timfjord commented 2 years ago

Hm, that's strange

And what does sublime.load_settings('Preferences.sublime-settings').get('theme') return?

pelemarse commented 2 years ago

Hm, that's strange

And what does sublime.load_settings('Preferences.sublime-settings').get('theme') return?

in my case returns 'auto'.

pelemarse commented 2 years ago

Hm, that's strange

And what does sublime.load_settings('Preferences.sublime-settings').get('theme') return?

if i change from 'auto' to "Default Theme" then it returns 'Default.sublime-theme' and:

  1. MacOS Appearance in System Preferences 'Auto':
    sublime.ui_info()['theme']['style'] # return 'light'
    sublime.ui_info()['system']['style'] # return 'light'
  2. MacOS Appearance in System Preferences 'Dark':
    sublime.ui_info()['theme']['style'] # return 'light'
    sublime.ui_info()['system']['style'] # return 'dark'
pelemarse commented 2 years ago

Probably need to add if sublime.ui_info()['theme']['style'] is 'system' than choose current_style = sublime.ui_info()['system']['style']

timfjord commented 2 years ago

I personally think it is a sublime bug, because the style should always be either light or dark, and there is the value key that can be auto. I also use auto but the style is always either light or dark for me

There are no specs for the ui_info method on the API Reference page so it is hard to say what is the expected behaviour. But I guess it is safe to apply the suggested fix