diff --git a/ChangeLog b/ChangeLog index 92807f9..b9de434 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3395,3 +3395,12 @@ Tue Mar 28 18:42:09 PST 2000 Michael Jennings 30% shade to the scrollbar anchor. ------------------------------------------------------------------------------- +Thu Mar 30 20:34:10 PST 2000 Michael Jennings + + Quick little option -q/--no-input. It keeps Eterm from accepting + keyboard input, and keeps the window manager from focusing it. Useful + for log tailers and such, maybe. This feature was requested by + Peter Ward . I will be adding an escape sequence to + toggle this. + +------------------------------------------------------------------------------- diff --git a/src/events.c b/src/events.c index 2149641..036fffa 100644 --- a/src/events.c +++ b/src/events.c @@ -209,7 +209,9 @@ handle_key_press(event_t * ev) REQUIRE_RVAL(XEVENT_IS_MYWIN(ev, &primary_data), 0); COUNT_EVENT(keypress_cnt); - lookup_key(ev); + if (!(Options & Opt_no_input)) { + lookup_key(ev); + } PROF_DONE(handle_key_press); PROF_TIME(handle_key_press); return 1; diff --git a/src/options.c b/src/options.c index 575cf2a..34049b6 100644 --- a/src/options.c +++ b/src/options.c @@ -297,8 +297,9 @@ static const struct { OPT_BOOL('s', "scrollbar", "display scrollbar", &Options, Opt_scrollbar), OPT_BOOL('u', "utmp-logging", "make a utmp entry", &Options, Opt_utmpLogging), OPT_BOOL('v', "visual-bell", "visual bell", &Options, Opt_visualBell), - OPT_BOOL('H', "home-on-echo", "jump to bottom on output", &Options, Opt_home_on_output), + OPT_BOOL('H', "home-on-output", "jump to bottom on output", &Options, Opt_home_on_output), OPT_BLONG("home-on-input", "jump to bottom on input", &Options, Opt_home_on_input), + OPT_BOOL('q', "no-input", "configure for output only", &Options, Opt_no_input), OPT_BLONG("scrollbar-right", "display the scrollbar on the right", &Options, Opt_scrollbar_right), OPT_BLONG("scrollbar-floating", "display the scrollbar with no trough", &Options, Opt_scrollbar_floating), OPT_BLONG("scrollbar-popup", "popup the scrollbar only when focused", &Options, Opt_scrollbar_popup), @@ -872,7 +873,6 @@ get_options(int argc, char *argv[]) } if (!strcasecmp(opt, "exec")) { D_OPTIONS(("--exec option detected\n")); - Options |= Opt_exec; if (!hasequal) { register unsigned short k, len = argc - i; @@ -987,7 +987,6 @@ get_options(int argc, char *argv[]) register unsigned short k, len; D_OPTIONS(("-e option detected\n")); - Options |= Opt_exec; if (opt[pos + 1]) { len = argc - i + 2; @@ -2134,6 +2133,13 @@ parse_toggles(char *buff, void *state) Options &= ~(Opt_home_on_input); } + } else if (!BEG_STRCASECMP(buff, "no_input ")) { + if (bool_val) { + Options |= Opt_no_input; + } else { + Options &= ~(Opt_no_input); + } + } else if (!BEG_STRCASECMP(buff, "scrollbar_floating ")) { if (bool_val) { Options |= Opt_scrollbar_floating; @@ -2433,8 +2439,6 @@ parse_misc(char *buff, void *state) register unsigned short k, n; - Options |= Opt_exec; - RESET_AND_ASSIGN(rs_execArgs, (char **) MALLOC(sizeof(char *) * ((n = NumWords(PWord(2, buff))) + 1))); for (k = 0; k < n; k++) { @@ -4463,6 +4467,7 @@ save_config(char *path) fprintf(fp, " iconic %d\n", (Options & Opt_iconic ? 1 : 0)); fprintf(fp, " home_on_output %d\n", (Options & Opt_home_on_output ? 1 : 0)); fprintf(fp, " home_on_input %d\n", (Options & Opt_home_on_input ? 1 : 0)); + fprintf(fp, " no_input %d\n", (Options & Opt_no_input ? 1 : 0)); fprintf(fp, " scrollbar_floating %d\n", (Options & Opt_scrollbar_floating ? 1 : 0)); fprintf(fp, " scrollbar_right %d\n", (Options & Opt_scrollbar_right ? 1 : 0)); fprintf(fp, " scrollbar_popup %d\n", (Options & Opt_scrollbar_popup ? 1 : 0)); @@ -4521,7 +4526,7 @@ save_config(char *path) fprintf(fp, " border_width %d\n", TermWin.internalBorder); fprintf(fp, " term_name %s\n", getenv("TERM")); fprintf(fp, " debug %d\n", debug_level); - if (Options & Opt_exec && rs_execArgs) { + if (rs_execArgs) { fprintf(fp, " exec "); for (i = 0; rs_execArgs[i]; i++) { fprintf(fp, "'%s' ", rs_execArgs[i]); diff --git a/src/options.h b/src/options.h index c8ddc63..8b537e3 100644 --- a/src/options.h +++ b/src/options.h @@ -61,22 +61,22 @@ # define Opt_utmpLogging (1LU << 6) # define Opt_scrollbar (1LU << 7) # define Opt_meta8 (1LU << 8) -# define Opt_exec (1LU << 9) -# define Opt_home_on_output (1LU << 10) -# define Opt_scrollbar_right (1LU << 11) -# define Opt_borderless (1LU << 12) -# define Opt_backing_store (1LU << 13) -# define Opt_noCursor (1LU << 14) -# define Opt_pause (1LU << 15) -# define Opt_home_on_input (1LU << 16) -# define Opt_report_as_keysyms (1LU << 17) -# define Opt_xterm_select (1LU << 18) -# define Opt_select_whole_line (1LU << 19) -# define Opt_scrollbar_popup (1LU << 20) -# define Opt_select_trailing_spaces (1LU << 21) -# define Opt_install (1LU << 22) -# define Opt_scrollbar_floating (1LU << 23) -# define Opt_double_buffer (1LU << 24) +# define Opt_home_on_output (1LU << 9) +# define Opt_scrollbar_right (1LU << 10) +# define Opt_borderless (1LU << 11) +# define Opt_backing_store (1LU << 12) +# define Opt_noCursor (1LU << 13) +# define Opt_pause (1LU << 14) +# define Opt_home_on_input (1LU << 15) +# define Opt_report_as_keysyms (1LU << 16) +# define Opt_xterm_select (1LU << 17) +# define Opt_select_whole_line (1LU << 18) +# define Opt_scrollbar_popup (1LU << 19) +# define Opt_select_trailing_spaces (1LU << 20) +# define Opt_install (1LU << 21) +# define Opt_scrollbar_floating (1LU << 22) +# define Opt_double_buffer (1LU << 23) +# define Opt_no_input (1LU << 24) # define IMOPT_TRANS (1U << 0) # define IMOPT_ITRANS (1U << 1) diff --git a/src/windows.c b/src/windows.c index ffd10df..655620b 100644 --- a/src/windows.c +++ b/src/windows.c @@ -425,7 +425,7 @@ Create_Windows(int argc, char *argv[]) classHint.res_name = (char *) rs_name; classHint.res_class = APL_NAME; wmHint.window_group = TermWin.parent; - wmHint.input = True; + wmHint.input = ((Options & Opt_no_input) ? False : True); wmHint.initial_state = (Options & Opt_iconic ? IconicState : NormalState); wmHint.window_group = TermWin.parent; wmHint.flags = (InputHint | StateHint | WindowGroupHint);