File: hemlock-termcap-fix.patch

package info (click to toggle)
cmucl 21d-2.1
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 45,364 kB
  • sloc: lisp: 378,758; ansic: 30,678; asm: 2,977; sh: 1,417; makefile: 352; csh: 31
file content (29 lines) | stat: -rw-r--r-- 950 bytes parent folder | download | duplicates (3)
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
Description: We need to get termcap info from infocmp not from a file on debian
Author: Peter Van Eynde <pvaneynd@debian.org>
Forwarded: TBD


--- cmucl.orig/src/hemlock/termcap.lisp
+++ cmucl/src/hemlock/termcap.lisp
@@ -39,10 +39,18 @@
 	    (with-input-from-string (s termcap-env-var)
 	      (skip-termcap-names s)
 	      (parse-fields s)))
-	(with-open-file (s termcap-file)
-	  (if (find-termcap-entry name s)
+	(let* ((proc
+		 (ext:run-program "/usr/bin/infocmp"
+		                  (list (cdr (assoc :TERM *ENVIRONMENT-LIST*)))
+		         	:wait nil
+			 	:input nil
+			 	:output :stream))
+	        (s (process-output proc)))
+	  (unwind-protect
+	(if (find-termcap-entry name s)
 	      (parse-fields s)
-	      (error "Unknown Terminal ~S in file ~S." name termcap-file))))))
+	      (error "Unknown Terminal ~S in file ~S." name termcap-file))
+	(process-close proc))))))
 
 (declaim (inline termcap))
 (defun termcap (name termcap)