--- /home/greg/Tmp/fricas/src/hyper/spadint.c	2024-12-22 23:32:24.397858998 +0100
+++ src/hyper/spadint.c	2024-12-24 00:33:46.180361514 +0100
@@ -183,16 +183,20 @@
 start_user_buffer(HyperDocPage *page)
 {
     char buf[1024], *title;
-    char *SPAD;
+    char *SPAD, *TERM;
     char spadbuf[250];
     char complfile[250];
     int ret_val;
 
+    TERM = (char *) getenv("FRICASTERM");
     SPAD = (char *) getenv("FRICAS");
     if (SPAD == NULL) {
         fprintf(stderr, "start_user_buffer: $FRICAS is empty\n");
         exit(-1);
     }
+    if (TERM == NULL)
+        TERM = "xterm";
+
     sprintf(spadbuf, "%s/lib/spadbuf", SPAD);
     sprintf(complfile, "%s/lib/command.list", SPAD);
     title = print_to_string(page->title);
@@ -203,19 +207,20 @@
          * defaults in the usual way
          */
         sprintf(buf,
-        "xterm -sb -sl 500 -name fricasclient -n '%s' -T '%s' -e  %s %s %s&",
-                title, title, spadbuf, page->name, complfile);
+        "%s -sb -sl 500 -name fricasclient -n '%s' -T '%s' -e  %s %s %s&",
+                TERM, title, title, spadbuf, page->name, complfile);
     else
         sprintf(buf,
-         "xterm -sb -sl 500 -name fricasclient -n '%s' -T '%s' -e  %s '%s'&",
-                title, title, spadbuf, page->name);
-    ret_val = system(buf);
-    if (ret_val == -1 || ret_val == 127) {
+         "%s -sb -sl 500 -name fricasclient -n '%s' -T '%s' -e  %s '%s'&",
+                TERM, title, title, spadbuf, page->name);
+    /*
+     * ret_val = system(buf);
+     * if (ret_val == -1 || ret_val == 127) {
 
-        /*
+         *
          * perror("running the xterm spadbuf program"); exit(-1);
-         */
-    }
+         *
+    }*/
     accept_menu_server_connection(page);
     fricas_sleep(100);
 }
