From cecfdea64b53ed96864088dd1b535271beb6d21b Mon Sep 17 00:00:00 2001
From: Stefan Monnier <monnier@iro.umontreal.ca>
Date: Tue, 30 Sep 2008 22:06:15 +0000
Subject: [PATCH] (Fsend_string_to_terminal): Don't try to send a string to a
 suspended terminal.

---
 src/ChangeLog | 11 +++++++----
 src/dispnew.c |  3 +++
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/ChangeLog b/src/ChangeLog
index 8007e948323..5d3972ca185 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2008-09-30  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* dispnew.c (Fsend_string_to_terminal): Don't try to send a string to
+	a suspended terminal.
+
 2008-09-30  Michael Albinus  <michael.albinus@gmx.de>
 
 	* dbusbind.c (xd_signature): Use strcat instead of sprintf.
@@ -30,13 +35,11 @@
 
 2008-09-28  Dan Nicolaescu  <dann@ics.uci.edu>
 
-	* dispnew.c (init_display): Return earlier when running as a
-	daemon.
+	* dispnew.c (init_display): Return earlier when running as a daemon.
 
 2008-09-27  Adrian Robert  <Adrian.B.Robert@gmail.com>
 
-	* nsfont.m (nsfont_draw): Fix up composition rendering (cmp_from,
-	etc.).
+	* nsfont.m (nsfont_draw): Fix up composition rendering (cmp_from, ...).
 
 2008-09-27  Eli Zaretskii  <eliz@gnu.org>
 
diff --git a/src/dispnew.c b/src/dispnew.c
index 307515f7bfb..33bbdca6700 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -6465,6 +6465,9 @@ currently selected frame.  */)
 
   tty = t->display_info.tty;
 
+  if (! tty->output)
+    error ("Terminal is currently suspended");
+
   if (tty->termscript)
     {
       fwrite (SDATA (string), 1, SBYTES (string), tty->termscript);
-- 
2.39.5