cscope/cscope-ctrlz.patch

44 lines
1.5 KiB
Diff

# restore control-z functionality of interactive cscope.
# version 15.6 (and previous) had control-z functionality because
# the terminal was in cbreak mode. Putting the terminal in raw mode
# fixed using control-c to change the 'ignore case mode'.
# catch the control-z and send ourself the suspend signal.
# rcoe@wi.rr.com
#
--- cscope-15.7a/src/command.c 2009-04-10 08:40:36.000000000 -0500
+++ cscope-15.7a.orig/src/command.c 2011-06-10 09:33:21.862932467 -0500
@@ -634,11 +634,13 @@ changestring(void)
atchange();
/* get a character from the terminal */
- if ((c = mygetch()) == EOF
- || c == ctrl('D')
- || c == ctrl('Z')) {
+ if ((c = mygetch()) == EOF || c == ctrl('D')) {
break; /* change lines */
}
+ if (c == ctrl('Z')) {
+ kill(0, SIGTSTP);
+ goto same;
+ }
/* see if the input character is a command */
switch (c) {
case ' ': /* display next page */
--- cscope-15.7a/src/main.c 2011-06-09 15:36:06.275174224 -0500
+++ cscope-15.7a.orig/src/main.c 2011-06-10 09:39:17.120599658 -0500
@@ -707,9 +707,13 @@ cscope: cannot read source file name fro
atfield(); /* move to the input field */
/* exit if the quit command is entered */
- if ((c = mygetch()) == EOF || c == ctrl('D') || c == ctrl('Z')) {
+ if ((c = mygetch()) == EOF || c == ctrl('D')) {
break;
}
+ if (c == ctrl('Z')) {
+ kill(0, SIGTSTP);
+ continue;
+ }
/* execute the commmand, updating the display if necessary */
if (command(c) == YES) {
display();