mirror of
				https://github.com/janet-lang/janet
				synced 2025-10-31 15:43:01 +00:00 
			
		
		
		
	Enable suspending repl with ctrl-z.
This commit is contained in:
		| @@ -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(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Calvin Rose
					Calvin Rose