Handle ctrl+z from readline
This commit is contained in:
parent
adc06dd705
commit
bca16a0581
@ -232,6 +232,10 @@ Interface.prototype._ttyWrite = function (b) {
|
|||||||
this._historyPrev();
|
this._historyPrev();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 26: /* ctrl+z */
|
||||||
|
process.kill(process.pid, "SIGTSTP");
|
||||||
|
return;
|
||||||
|
|
||||||
case 27: /* escape sequence */
|
case 27: /* escape sequence */
|
||||||
if (b[1] === 98 && this.cursor > 0) { // meta-b - backward word
|
if (b[1] === 98 && this.cursor > 0) { // meta-b - backward word
|
||||||
|
|
||||||
|
@ -180,6 +180,13 @@ void Stdio::Flush() {
|
|||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void HandleSIGCONT (int signum) {
|
||||||
|
if (rawmode) {
|
||||||
|
rawmode = 0;
|
||||||
|
EnableRawMode(STDIN_FILENO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Stdio::Initialize(v8::Handle<v8::Object> target) {
|
void Stdio::Initialize(v8::Handle<v8::Object> target) {
|
||||||
HandleScope scope;
|
HandleScope scope;
|
||||||
@ -199,6 +206,11 @@ void Stdio::Initialize(v8::Handle<v8::Object> target) {
|
|||||||
NODE_SET_METHOD(target, "isStdinBlocking", IsStdinBlocking);
|
NODE_SET_METHOD(target, "isStdinBlocking", IsStdinBlocking);
|
||||||
NODE_SET_METHOD(target, "setRawMode", SetRawMode);
|
NODE_SET_METHOD(target, "setRawMode", SetRawMode);
|
||||||
NODE_SET_METHOD(target, "getColumns", GetColumns);
|
NODE_SET_METHOD(target, "getColumns", GetColumns);
|
||||||
|
|
||||||
|
struct sigaction sa;
|
||||||
|
bzero(&sa, sizeof(sa));
|
||||||
|
sa.sa_handler = HandleSIGCONT;
|
||||||
|
sigaction(SIGCONT, &sa, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user