tb Allow the user to kill current process in interactive mode (Ctrl+S)
This commit is contained in:
@ -2,9 +2,7 @@
|
||||
#include <stddef.h>
|
||||
#include <ulib.h>
|
||||
#include "interp.h"
|
||||
|
||||
// keys
|
||||
#define C(X) ((X)-'@')
|
||||
#include "macros.h"
|
||||
|
||||
#define LINEBUF_MAX 1024
|
||||
|
||||
@ -75,7 +73,7 @@ void do_file(char *filepath) {
|
||||
}
|
||||
|
||||
InterpResult *res;
|
||||
bool ok = interp_runstring((const char *)buf, &res, CONFIG.logcmds);
|
||||
bool ok = interp_runstring((const char *)buf, &res, CONFIG.logcmds, CONFIG.mode == MODE_INTERACTIVE);
|
||||
if (!ok) {
|
||||
uprintf("Interpreter error:\n");
|
||||
uprintf("%s\n", res->errmsg);
|
||||
@ -130,7 +128,7 @@ void do_mode_interactive(void) {
|
||||
}
|
||||
uprintf("\n");
|
||||
InterpResult *res;
|
||||
if (!interp_runstring(linebuf, &res, CONFIG.logcmds)) {
|
||||
if (!interp_runstring(linebuf, &res, CONFIG.logcmds, CONFIG.mode == MODE_INTERACTIVE)) {
|
||||
LOG(LOG_ERR, "%s\n", res->errmsg);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user