commit d12fa94

chld  ·  2026-09-20 01:57:59 +0000 UTC
parent 60cda63
fix menu overwriting dead items
1 files changed,  +5, -5
+5, -5
 1@@ -3,6 +3,8 @@
 2              (ncurses curses)
 3              (ncurses menu))
 4 
 5+(define NAME (basename (car (command-line))))
 6+
 7 (define (list-directory path)
 8   (let ((dir (opendir path)))
 9     (let loop ((file (readdir dir))
10@@ -19,7 +21,7 @@
11 (noecho!)
12 (keypad! stdscr #t)
13 
14-(display "\x1b]0;gmenu\x07")
15+(format #t "\x1b]0;~a\x07" NAME)
16 (force-output)
17 
18 (let fs ((names (list-directory "."))
19@@ -29,11 +31,11 @@
20 
21   ;;  (move stdscr (- (lines) 2) 0)(addstr ")
22 
23+  (clear stdscr)(refresh stdscr)
24   (post-menu my-menu)
25-  (refresh stdscr)
26 
27   (let loop ((c (getch stdscr)))
28-    (format #t "\x1b]0;gmenu: ~a\x07" (item-name (current-item my-menu)))
29+    (format #t "\x1b]0;~a: ~a\x07" NAME (item-name (current-item my-menu)))
30     (force-output)
31     (cond
32      ((eqv? c KEY_DOWN)
33@@ -53,7 +55,6 @@
34 	       (chdir
35 		(format #f "~a/~a" (getcwd) (item-name (current-item my-menu))))
36 	       (fs (list-directory (getcwd)))
37-	       (refresh stdscr)
38 	       )
39 	     (lambda (key . args)
40 	       (+ 60 7)
41@@ -68,7 +69,6 @@
42 	       (chdir
43 		(format #f "~a/~a" (getcwd) ".."))
44 	       (fs (list-directory (getcwd)))
45-	       (refresh stdscr)
46 	       )
47 	     (lambda (key . args)
48 	       (+ 60 7)