]> code.citadel.org Git - citadel.git/commitdiff
* citadel.c, citadel.h, commands.c: make client suspendable
authorNathan Bryant <loanshark@uncensored.citadel.org>
Sun, 25 Oct 1998 00:48:23 +0000 (00:48 +0000)
committerNathan Bryant <loanshark@uncensored.citadel.org>
Sun, 25 Oct 1998 00:48:23 +0000 (00:48 +0000)
citadel/ChangeLog
citadel/citadel.c
citadel/citadel.h
citadel/commands.c

index 046cefc97ae77c407456302e02a8364e53ca2782..99c2b4d69db2e7f1364b1e2261f8f5599533b350 100644 (file)
@@ -4,6 +4,7 @@
          Makefile is regenerated when Makefile.in changes (ditto);
          `realclean' is now known as `distclean';
          portability fixes for older Unix make utilities
+       * citadel.c, citadel.h, commands.c: make client suspendable
 
 Fri Oct 23 19:34:38 EDT 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * setup.c: default node name is now obtained from uname()
index 95749af7984af997b2609a2061dd46e251e2f92d..7ee7c9bc3c871752f221aed9ac030ec2125402ba 100644 (file)
@@ -142,6 +142,16 @@ void dropcarr(int signum) {
 
 
 
+/*
+ * catch SIGCONT to reset terminal modes when were are put back into the
+ * foreground.
+ */
+void catch_sigcont(int signum) {
+       sttybbs(SB_LAST);
+       }
+
+
+
 /* general purpose routines */
 
 void formout(char *name) /* display a file */
@@ -796,6 +806,7 @@ signal(SIGINT,SIG_IGN);
 signal(SIGQUIT,SIG_IGN);
 signal(SIGHUP,dropcarr);       /* Cleanup gracefully if carrier is dropped */
 signal(SIGTERM,dropcarr);      /* Cleanup gracefully if terminated */
+signal(SIGCONT,catch_sigcont);  /* Catch SIGCONT so we can reset terminal */
 
 send_ansi_detect();
 printf("Attaching to server...\r");
index c82702d1c8c5eac89d793ba8883daa88c500f3db..8bf269ee2fb6f0f8d22f48e1271cc770e97009ea 100644 (file)
@@ -211,6 +211,7 @@ struct floor {
 #define SB_YES_INTR    1               /* set to bbs mode, i/q enabled */
 #define SB_SAVE                2               /* save settings */
 #define SB_RESTORE     3               /* restore settings */
+#define SB_LAST                4               /* redo the last command sent */
 
 #define        NEXT_KEY        15
 #define STOP_KEY       3
index 85080bd44572bcbba0303e3f608c9fb982a1f4d7..b77378496f27f5bb01ff229fbb31542680fcb33a 100644 (file)
@@ -659,13 +659,18 @@ void sttybbs(int cmd)             /* SysV version of sttybbs() */
          {
        struct termios live;
        static struct termios saved_settings;
+       static int last_cmd = 0;
+
+       if (cmd == SB_LAST)
+               cmd = last_cmd;
+       else
+               last_cmd = cmd;
 
        if ( (cmd == 0) || (cmd == 1) ) {
                tcgetattr(0,&live);
                live.c_iflag=ISTRIP|IXON|IXANY;
                live.c_oflag=OPOST|ONLCR;
-               live.c_lflag=NOFLSH;
-               if (cmd==1) live.c_lflag=ISIG|NOFLSH;
+               live.c_lflag=ISIG|NOFLSH;
 
                if (cmd==SB_YES_INTR) {
                        live.c_cc[VINTR]=NEXT_KEY;