diff --git a/common/utils/T/tracer/gui/text_list.c b/common/utils/T/tracer/gui/text_list.c
index 59de2809d79cd7cbe4682cfcb5fdddf8857f25ca..bd664bdb65720f6cb21c933f1bccc9873875819c 100644
--- a/common/utils/T/tracer/gui/text_list.c
+++ b/common/utils/T/tracer/gui/text_list.c
@@ -16,10 +16,12 @@ printf("PAINT text_list %p xywh %d %d %d %d\n", _this, this->common.x, this->com
       this->common.width, this->common.height);
   for (i = 0, j = this->starting_line;
        i < this->allocated_nlines && j < this->text_count; i++, j++)
-    x_draw_string(g->x, g->xwin, FOREGROUND_COLOR,
+    x_draw_clipped_string(g->x, g->xwin, FOREGROUND_COLOR,
         this->common.x,
         this->common.y + i * this->line_height + this->baseline,
-        this->text[j]);
+        this->text[j],
+        this->common.x, this->common.y,
+        this->common.width, this->common.height);
 }
 
 static void hints(gui *_gui, widget *_w, int *width, int *height)
diff --git a/common/utils/T/tracer/gui/x.c b/common/utils/T/tracer/gui/x.c
index e68e3bcb928f8b1e3701a625c49e6ae13d5c4ecb..d739cc9b4f75154759b4b470b7fab87681ab2d6f 100644
--- a/common/utils/T/tracer/gui/x.c
+++ b/common/utils/T/tracer/gui/x.c
@@ -279,6 +279,18 @@ void x_draw_string(x_connection *_c, x_window *_w, int color,
   XDrawString(c->d, w->p, c->colors[color], x, y, t, tlen);
 }
 
+void x_draw_clipped_string(x_connection *_c, x_window *_w, int color,
+    int x, int y, const char *t,
+    int clipx, int clipy, int clipwidth, int clipheight)
+{
+  struct x_connection *c = _c;
+
+  XRectangle clip = { clipx, clipy, clipwidth, clipheight };
+  XSetClipRectangles(c->d, c->colors[color], 0, 0, &clip, 1, Unsorted);
+  x_draw_string(_c, _w, color, x, y, t);
+  XSetClipMask(c->d, c->colors[color], None);
+}
+
 void x_draw(x_connection *_c, x_window *_w)
 {
   struct x_connection *c = _c;
diff --git a/common/utils/T/tracer/gui/x.h b/common/utils/T/tracer/gui/x.h
index e8f1d42d136fdfb979c5eea7b74c95649e52401b..165785923cf369aaaeb02c58d9b426148f0a6fb4 100644
--- a/common/utils/T/tracer/gui/x.h
+++ b/common/utils/T/tracer/gui/x.h
@@ -41,6 +41,10 @@ void x_fill_rectangle(x_connection *c, x_window *w, int color,
 void x_draw_string(x_connection *_c, x_window *_w, int color,
     int x, int y, const char *t);
 
+void x_draw_clipped_string(x_connection *_c, x_window *_w, int color,
+    int x, int y, const char *t,
+    int clipx, int clipy, int clipwidth, int clipheight);
+
 /* specials functions to plot many points
  * you call several times x_add_point() then x_plot_points()
  */