blob: 0a90f9f13ae462a53461fd8f13da081462a4c300 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
From 55462e60b520746e4265c9165164cbb467ec3162 Mon Sep 17 00:00:00 2001
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Tue, 25 Mar 2025 21:23:41 +0100
Subject: [PATCH] ipython: Defaut to black on white on unknown ansi color
This avoids breaking whenever a newer IPython starts using a new
combination.
Fixes #65
---
plugins/ipython_view.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/plugins/ipython_view.py b/plugins/ipython_view.py
index 91be14e..3160b2c 100755
--- a/plugins/ipython_view.py
+++ b/plugins/ipython_view.py
@@ -481,6 +481,8 @@ class ConsoleView(gtk.TextView):
ansi_tags = self.color_pat.findall(text)
for tag in ansi_tags:
i = segments.index(tag)
+ if tag not in self.ANSI_COLORS:
+ tag = '0;30'
self.text_buffer.insert_with_tags_by_name(self.text_buffer.get_end_iter(),
segments[i+1], tag)
segments.pop(i)
--
GitLab
|