2 * ========================================================================
3 * Copyright 2006-2007 University of Washington
4 * Copyright 2013-2022 Eduardo Chappa
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * ========================================================================
19 #include "../estruct.h"
24 #include "../keydefs.h"
37 /* internal prototypes */
39 RETSIGTYPE
rtfrmshell(int);
46 * bktoshell - suspend and wait to be woken up
49 bktoshell(int f
, int n
)
59 if(!Pmaster
->suspend
){
64 if((*Pmaster
->suspend
)() == NO_OP_COMMAND
){
74 rv
= (*Pmaster
->showmsg
)('x');
77 if(rv
) /* Did showmsg corrupt the display? */
78 pico_refresh(0, 1); /* Yes, repaint */
88 pclear(0, term
.t_nrow
);
102 printf("\n\n\nUse \"exit\" to return to Pi%s\n",
103 (gmode
& MDBRONLY
) ? "lot" : "co");
104 system((shell
= (char *)getenv("SHELL")) ? shell
: "/bin/csh");
105 rtfrmshell(dummy
); /* fixup tty */
108 movecursor(term
.t_nrow
-1, 0);
110 movecursor(term
.t_nrow
, 0);
112 movecursor(term
.t_nrow
, 0);
113 printf("\n\n\nUse \"fg\" to return to Pi%s\n",
114 (gmode
& MDBRONLY
) ? "lot" : "co");
116 movecursor(term
.t_nrow
, 0);
120 signal(SIGCONT
, rtfrmshell
); /* prepare to restart */
121 signal(SIGTSTP
, SIG_DFL
); /* prepare to stop */
130 bktoshell(int f
, int n
)
139 if(!Pmaster
->suspend
){
143 (*Pmaster
->suspend
)();
150 #endif /* _WINDOWS */
156 * rtfrmshell - back from shell, fix modes and return
161 signal(SIGCONT
, SIG_DFL
);
164 pclear(0, term
.t_nrow
);