mirror of
https://github.com/janet-lang/janet
synced 2024-12-26 00:10: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
|
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
# IN THE SOFTWARE.
|
# 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
|
TARGET=hello.so
|
||||||
|
|
||||||
UNAME:=$(shell uname -s)
|
UNAME:=$(shell uname -s)
|
||||||
|
@ -81,6 +81,7 @@ https://github.com/antirez/linenoise/blob/master/linenoise.c
|
|||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <signal.h>
|
||||||
|
|
||||||
#include <headerlibs/vector.h>
|
#include <headerlibs/vector.h>
|
||||||
|
|
||||||
@ -349,6 +350,11 @@ static int line() {
|
|||||||
pos = len = 0;
|
pos = len = 0;
|
||||||
refresh();
|
refresh();
|
||||||
break;
|
break;
|
||||||
|
case 26: /* ctrl-z */
|
||||||
|
norawmode();
|
||||||
|
kill(getpid(), SIGSTOP);
|
||||||
|
rawmode();
|
||||||
|
break;
|
||||||
case 12:
|
case 12:
|
||||||
clear();
|
clear();
|
||||||
refresh();
|
refresh();
|
||||||
|
Loading…
Reference in New Issue
Block a user