mirror of
https://github.com/janet-lang/janet
synced 2024-12-25 07:50:27 +00:00
Enable suspending repl with ctrl-z.
This commit is contained in:
parent
6e45b96644
commit
ceff49a08d
@ -18,7 +18,7 @@
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
# IN THE SOFTWARE.
|
||||
|
||||
CFLAGS=-std=c99 -Wall -Wextra -I../../src/include -s -O3
|
||||
CFLAGS=-std=c99 -Wall -Wextra -I../../src/include -O2
|
||||
TARGET=hello.so
|
||||
|
||||
UNAME:=$(shell uname -s)
|
||||
|
@ -81,6 +81,7 @@ https://github.com/antirez/linenoise/blob/master/linenoise.c
|
||||
#include <sys/ioctl.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include <headerlibs/vector.h>
|
||||
|
||||
@ -349,6 +350,11 @@ static int line() {
|
||||
pos = len = 0;
|
||||
refresh();
|
||||
break;
|
||||
case 26: /* ctrl-z */
|
||||
norawmode();
|
||||
kill(getpid(), SIGSTOP);
|
||||
rawmode();
|
||||
break;
|
||||
case 12:
|
||||
clear();
|
||||
refresh();
|
||||
|
Loading…
Reference in New Issue
Block a user