The terminal is not supposed to send signals to the shell. That's done
by the tty. Now I also understand the BeOS work-around to ignore SIGINT in bash I removed recently. I suppose the signal code is still needed for BeOS. If not please remove it. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25403 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -194,16 +194,24 @@ Shell::UpdateWindowSize(int rows, int columns)
|
|||||||
struct winsize winSize;
|
struct winsize winSize;
|
||||||
winSize.ws_row = rows;
|
winSize.ws_row = rows;
|
||||||
winSize.ws_col = columns;
|
winSize.ws_col = columns;
|
||||||
|
#ifdef __HAIKU__
|
||||||
|
if (ioctl(fFd, TIOCSWINSZ, &winSize) != 0)
|
||||||
|
return errno;
|
||||||
|
return B_OK;
|
||||||
|
#else
|
||||||
ioctl(fFd, TIOCSWINSZ, &winSize);
|
ioctl(fFd, TIOCSWINSZ, &winSize);
|
||||||
return Signal(SIGWINCH);
|
return Signal(SIGWINCH);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef __HAIKU__
|
||||||
status_t
|
status_t
|
||||||
Shell::Signal(int signal)
|
Shell::Signal(int signal)
|
||||||
{
|
{
|
||||||
return send_signal(-fProcessID, signal);
|
return send_signal(-fProcessID, signal);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
|
|||||||
@@ -32,7 +32,9 @@ public:
|
|||||||
ssize_t Write(const void *buffer, size_t numBytes);
|
ssize_t Write(const void *buffer, size_t numBytes);
|
||||||
|
|
||||||
status_t UpdateWindowSize(int row, int columns);
|
status_t UpdateWindowSize(int row, int columns);
|
||||||
|
#ifndef __HAIKU__
|
||||||
status_t Signal(int signal);
|
status_t Signal(int signal);
|
||||||
|
#endif
|
||||||
|
|
||||||
status_t GetAttr(struct termios &attr);
|
status_t GetAttr(struct termios &attr);
|
||||||
status_t SetAttr(struct termios &attr);
|
status_t SetAttr(struct termios &attr);
|
||||||
|
|||||||
@@ -1471,6 +1471,7 @@ TermView::KeyDown(const char *bytes, int32 numBytes)
|
|||||||
currentMessage->FindInt32("key", &key);
|
currentMessage->FindInt32("key", &key);
|
||||||
currentMessage->FindInt32("raw_char", &rawChar);
|
currentMessage->FindInt32("raw_char", &rawChar);
|
||||||
|
|
||||||
|
#ifndef __HAIKU__
|
||||||
// If bytes[0] equal intr character,
|
// If bytes[0] equal intr character,
|
||||||
// send signal to shell process group.
|
// send signal to shell process group.
|
||||||
struct termios tio;
|
struct termios tio;
|
||||||
@@ -1479,6 +1480,7 @@ TermView::KeyDown(const char *bytes, int32 numBytes)
|
|||||||
if (tio.c_lflag & ISIG)
|
if (tio.c_lflag & ISIG)
|
||||||
fShell->Signal(SIGINT);
|
fShell->Signal(SIGINT);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Terminal filters RET, ENTER, F1...F12, and ARROW key code.
|
// Terminal filters RET, ENTER, F1...F12, and ARROW key code.
|
||||||
// TODO: Cleanup
|
// TODO: Cleanup
|
||||||
|
|||||||
Reference in New Issue
Block a user