1
0
mirror of https://github.com/janet-lang/janet synced 2024-06-16 02:09:56 +00:00

Enable suspending repl with ctrl-z.

This commit is contained in:
Calvin Rose 2018-06-24 13:17:56 -04:00
parent 6e45b96644
commit ceff49a08d
2 changed files with 7 additions and 1 deletions

View File

@ -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)

View File

@ -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();