being incompatible with pico. Removed all code for different
search/replace string editing and alternate shortcut list. I'm sure
I won't even have to ask for feedback on this one :-)
+ - Add in Pico's -p flag, (-p, --preserve). To preserve the XON and XOFF
+ keys (^Q and ^S). Add warning if we invoke -p and add checks for
+ using --preserve (to skip warning) and --pico (to force showing it).
+ New flag PRESERVE, function do_preserve_msg(), changes to main(),
+ signal_init().
- Search history and replace history up/down cursor arrows, w/history
tab completion, not available w/NANO_SMALL. Changes to
statusq, others (Ken Tyler). Added shortcut to search/replace
#ifndef DISABLE_OPERATINGDIR
print1opt(_("-o [dir]"), _("--operatingdir=[dir]"), _("Set operating directory"));
#endif
+ print1opt(_("-p"), _("--preserve"), _("Preserve XON (^Q) and XOFF (^S) keys"));
#ifndef DISABLE_WRAPJUSTIFY
print1opt(_("-r [#cols]"), _("--fill=[#cols]"), _("Set fill cols to (wrap lines at) #cols"));
#endif
}
#endif
+void do_preserve_msg(void)
+{
+ fprintf(stderr, _("\nThe -p flag now invokes the Pico \"preserve\" flag. The Pico compatibility\n"));
+ fprintf(stderr, _("flag been removed as nano is now fully Pico compatible. Please see the nano\n"));
+ fprintf(stderr, _("FAQ for more info on this change...\n\n"));
+ fprintf(stderr, _("Press return to continue\n"));
+ while (getchar() != '\n');
+}
+
+
#ifndef NANO_SMALL
static int pid; /* This is the PID of the newly forked process
* below. It must be global since the signal
* handler needs it. */
-
RETSIGTYPE cancel_fork(int signal)
{
if (kill(pid, SIGKILL) == -1)
#ifdef _POSIX_VDISABLE
tcgetattr(0, &term);
- /* Ignore ^S, much to Chris' chagrin */
- term.c_cc[VSTOP] = _POSIX_VDISABLE;
-
+ if (!ISSET(PRESERVE)) {
+ /* Ignore ^S and ^Q, much to Chris' chagrin */
+ term.c_cc[VSTOP] = _POSIX_VDISABLE;
+ term.c_cc[VSTART] = _POSIX_VDISABLE;
+ }
#ifdef VDSUSP
term.c_cc[VDSUSP] = _POSIX_VDISABLE;
#endif /* VDSUSP */
int keyhandled; /* Have we handled the keystroke yet? */
int modify_control_seq;
const shortcut *s;
+#ifdef HAVE_GETOPT_LONG
+ int preserveopt = 0; /* Did the cmdline include --preserve? */
+#endif
#ifndef NANO_SMALL
const toggle *t;
#endif
#ifndef DISABLE_OPERATINGDIR
{"operatingdir", 1, 0, 'o'},
#endif
+ {"preserve", 0, 0, 'p'},
#ifndef DISABLE_WRAPJUSTIFY
{"fill", 1, 0, 'r'},
#endif
first, so that it's handled before we call do_rcfile() and
read the other options; don't use getopt()/getopt_long()
here, because there's no way to reset it properly
- afterward */
+ afterward. Also check for the --preserve flag, and report
+ error if people are still using --pico. */
int i;
for (i = 1; i < argc; i++) {
if (!strcmp(argv[i], "--"))
#ifdef HAVE_GETOPT_LONG
else if (!strcmp(argv[i], "--ignorercfiles"))
SET(NO_RCFILE);
+ else if (!strcmp(argv[i], "--preserve"))
+ preserveopt = 1;
+ else if (!strcmp(argv[i], "--pico"))
+ do_preserve_msg();
#endif
}
}
break;
#endif
case 'p':
+ SET(PRESERVE);
+#ifdef HAVE_GETOPT_LONG
+ if (!preserveopt)
+ do_preserve_msg();
+#endif
break;
#ifndef DISABLE_WRAPJUSTIFY
case 'r':
/* Don't even think about changing this string */
if (kbinput == 19)
statusbar(_("XOFF ignored, mumble mumble."));
+ if (kbinput == 17)
+ statusbar(_("XON ignored, mumble mumble."));
#endif
/* If we're in raw mode or using Alt-Alt-x, we have to catch
Control-S and Control-Q */