]> git.eshelyaron.com Git - emacs.git/commitdiff
If the daemon’s TTY is our only frame, create a new frame
authorPeter Oliver <git@mavit.org.uk>
Tue, 22 Jun 2021 13:21:33 +0000 (15:21 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 22 Jun 2021 13:21:33 +0000 (15:21 +0200)
* server.el (server-process-filter): If there won't be a current frame
to use, fall back to trying to create a new one (bug#11033).

lisp/server.el

index 3205ba182eefe0658f9d3ec6f0dcee78db661f70..ac5db197f3ececde16dd36d09cfebe84d55449fb 100644 (file)
@@ -1308,7 +1308,17 @@ The following commands are accepted by the client:
                                                       frame-parameters))
                   ;; When resuming on a tty, tty-name is nil.
                   (tty-name
-                   (server-create-tty-frame tty-name tty-type proc))))
+                   (server-create-tty-frame tty-name tty-type proc))
+
+                   ;; If there won't be a current frame to use, fall
+                   ;; back to trying to create a new one.
+                  ((and use-current-frame
+                        (daemonp)
+                        (null (cdr (frame-list)))
+                        (eq (selected-frame) terminal-frame)
+                        display)
+                   (setq tty-name nil tty-type nil)
+                   (server-select-display display))))
 
             (process-put
              proc 'continuation