Make terminal cursor colors fallback to foreground & background

This commit is contained in:
Vulcalien 2021-08-14 17:07:00 +02:00
parent eae7dcca3d
commit 880a15d5d3
1 changed files with 8 additions and 2 deletions

View File

@ -843,10 +843,16 @@ class Terminal(Gtk.VBox):
else: else:
# foreground # foreground
cursor_fg_color = Gdk.RGBA() cursor_fg_color = Gdk.RGBA()
if self.config['cursor_fg_color'] == '':
cursor_fg_color.parse(self.config['background_color'])
else:
cursor_fg_color.parse(self.config['cursor_fg_color']) cursor_fg_color.parse(self.config['cursor_fg_color'])
self.vte.set_color_cursor_foreground(cursor_fg_color) self.vte.set_color_cursor_foreground(cursor_fg_color)
# background # background
cursor_bg_color = Gdk.RGBA() cursor_bg_color = Gdk.RGBA()
if self.config['cursor_bg_color'] == '':
cursor_bg_color.parse(self.config['foreground_color'])
else:
cursor_bg_color.parse(self.config['cursor_bg_color']) cursor_bg_color.parse(self.config['cursor_bg_color'])
self.vte.set_color_cursor(cursor_bg_color) self.vte.set_color_cursor(cursor_bg_color)