]> git.eshelyaron.com Git - sweep.git/commitdiff
Revert "Set Prolog flag 'tty_control' to 'true' when using pty"
authorEshel Yaron <me@eshelyaron.com>
Sun, 22 Oct 2023 12:03:14 +0000 (14:03 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sun, 22 Oct 2023 12:03:14 +0000 (14:03 +0200)
This reverts commit d70195ede30df33098f58cc6ba5fd19c26495055.

sweep.pl
sweeprolog.el

index a83816fd178473f349d162dc83ce9be08bc5d026..6e0feec2b003fd265780adf388752851256511a5 100644 (file)
--- a/sweep.pl
+++ b/sweep.pl
@@ -782,7 +782,7 @@ sweep_top_level_start_pty(Name, Id) :-
 sweep_top_level_pty_client(Name) :-
     open(Name, read, InStream, [eof_action(reset)]),
     open(Name, write, OutStream),
-    sweep_top_level_client(InStream, OutStream, ip(127, 0, 0, 1), true).
+    sweep_top_level_client(InStream, OutStream, ip(127,0,0,1)).
 
 sweep_top_level_server(_, Port) :-
     tcp_socket(ServerSocket),
@@ -809,17 +809,17 @@ sweep_top_level_server_loop_(accept(From), ServerSocket) :-
     tcp_open_socket(Slave, InStream, OutStream),
     set_stream(InStream, close_on_abort(false)),
     set_stream(OutStream, close_on_abort(false)),
-    sweep_create_thread(sweep_top_level_client(InStream, OutStream, Peer, false), T),
+    sweep_create_thread(sweep_top_level_client(InStream, OutStream, Peer), T),
     thread_property(T, id(Id)),
     thread_send_message(From, client(Id)),
     sweep_top_level_server_loop(ServerSocket).
 sweep_top_level_server_loop_(_, _).
 
-sweep_top_level_client(InStream, OutStream, ip(127, 0, 0, 1), TC) :-
+sweep_top_level_client(InStream, OutStream, ip(127,0,0,1)) :-
     !,
     set_prolog_IO(InStream, OutStream, OutStream),
     set_stream(InStream, tty(true)),
-    set_prolog_flag(tty_control, TC),
+    set_prolog_flag(tty_control, false),
     set_prolog_flag(verbose, normal),
     set_prolog_flag(color_term, true),
     current_prolog_flag(encoding, Enc),
@@ -835,7 +835,7 @@ sweep_top_level_client(InStream, OutStream, ip(127, 0, 0, 1), TC) :-
                      close(OutStream, [force(true)])
                    )),
     prolog.
-sweep_top_level_client(InStream, OutStream, _, _) :-
+sweep_top_level_client(InStream, OutStream, _) :-
     close(InStream),
     close(OutStream).
 
index c057d5e4c9a6e1cf03600728df98654c371d2e1d..b0fd0e07cfa0c7669c702b6cbe485cfc9bcc8739 100644 (file)
@@ -3241,6 +3241,7 @@ top-level."
               (if sweeprolog-top-level-use-pty
                   (progn
                     (make-comint-in-buffer "sweeprolog-top-level" buf nil)
+                    (setq-local comint-process-echoes t)
                     (process-send-eof (get-buffer-process buf))
                     (sweeprolog--query-once "sweep" "sweep_top_level_start_pty"
                                             (process-tty-name (get-buffer-process buf))))
@@ -3250,6 +3251,7 @@ top-level."
                                        buf
                                        (cons "localhost"
                                              sweeprolog-prolog-server-port))
+                (setq-local comint-process-echoes nil)
                 (sweeprolog--query-once "sweep" "sweep_accept_top_level_client" nil)))
         (let ((proc (get-buffer-process buf)))
           (set-process-filter proc
@@ -3333,12 +3335,7 @@ appropriate buffer."
                                                   (- pend pstart))))
                  (not (string= "|: "   prompt))
                  (not (string= "|    " prompt)))
-        (let ((proc (get-buffer-process (current-buffer))))
-          (if (eq (process-type proc) 'network)
-              (comint-send-input)
-            (delete-char -1)
-            (process-send-string (get-buffer-process (current-buffer))
-                                 (char-to-string last-command-event))))))))
+        (comint-send-input)))))
 
 (defun sweeprolog-signal-thread (tid goal)
   (sweeprolog--query-once "sweep" "sweep_thread_signal"