]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - progs/tset.c
ncurses 6.4 - patch 20240323
[ncurses.git] / progs / tset.c
index 0ba522cbc4c6eed57bf8f9fa4010894f8d54980e..5255ef476c1defce7a1616bef362f2d3f04db156 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020,2021 Thomas E. Dickey                                     *
+ * Copyright 2020-2021,2024 Thomas E. Dickey                                *
  * Copyright 1998-2016,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -98,7 +98,7 @@
 char *ttyname(int fd);
 #endif
 
-MODULE_ID("$Id: tset.c,v 1.131 2021/12/04 23:02:13 tom Exp $")
+MODULE_ID("$Id: tset.c,v 1.132 2024/03/17 00:15:54 tom Exp $")
 
 #ifndef environ
 extern char **environ;
@@ -878,9 +878,15 @@ main(int argc, char **argv)
 
            if (!noinit) {
                if (send_init_strings(my_fd, &oldmode)) {
+                   const char *name;
+
                    (void) putc('\r', stderr);
                    (void) fflush(stderr);
-                   (void) napms(1000);         /* Settle the terminal. */
+                   if (isatty(my_fd)
+                       && (name = ttyname(my_fd)) != NULL
+                       && strncmp(name, "/dev/pts/", 9)) {
+                       (void) napms(1000);     /* Settle the terminal. */
+                   }
                }
            }