" [-B <ticks>[,<ticks>]] [-j <n>] [-P] [-m <mode>] [-M] [-d]\n"
" [-D] [-S] [-p <parameters>] [-g <w>,<h>] [-l <pixels>]\n"
" [-f <delay>] [-t] [-T <ticks>[,<ticks>]] [-U] [-z <ms>]\n"
- " [-Z <skip>] [-e <command> [<arguments>]]\n\n"
+ " [-Z <skip>] [-q] [-e <command> [<arguments>]]\n\n"
"Where:\n"
" -1 - Activate slow and smooth scrolling at startup.\n"
" Also see -j for more details.\n"
" -Z - If -z is enabled, specify the number of bytes to read\n"
" before sleeping. Useful when the scheduler cannot sleep\n"
" for short enough delays.\n"
+ " -q - Quiet: do not display the intro header at startup.\n"
" -e - Execute command and its arguments instead of $SHELL.\n"
" Must be the last AnalogTerm2 argument if used, because\n"
" other arguments will be passed to the command.\n"
screen_t *screen = NULL;
state_t *state = NULL;
struct pollfd pfd[2];
- int ch, i;
+ int ch, i, cfg_quiet;
char *command = NULL;
bool color_set = false;
cfg_setdefaults();
cfg_unicode = !locale_8bit();
+ cfg_quiet = false;
progname = strdup(argv[0]);
while ((ch = getopt(argc, argv,
- "?128uw:h:E:scC:Wr:R:bB:j:Pm:MdDStT:p:g:l:f:Uz:Z:e:")) != -1) {
+ "?128uw:h:E:scC:Wr:R:bB:j:Pm:MdDStT:p:g:l:f:Uz:Z:qe:")) != -1) {
switch (ch) {
case '1':
cfg_slowscroll = cfg_smoothscroll = true;
if ((i = atoi(optarg)) > -1)
cfg_inputsleepskip = inputsleepskip = i;
break;
+ case 'q':
+ cfg_quiet = true;
+ break;
case 'e':
{
int l;
/*
* Fancy retro welcome message.
*/
+ if (cfg_quiet)
+ goto noheader;
+
state_goto(state, 0, 1);
- state_printf(state, 0, "(%dx%d, %dx%d)",
+ state_printf(state, 0, "(Win: %dx%d, Txt: %dx%d, Fnt: %dx%d)",
screen->pixels_width, screen->pixels_height,
- cfg_text_width, cfg_text_height);
+ cfg_text_width, cfg_text_height,
+ cfg_font_width, cfg_font_height);
state_goto(state, 1, 1);
state_prints(state, "READY", 0);
state_goto(state, 1, (cfg_text_width / 2) - 17);
state_prints(state, "Revision ", TMODE_DIM);
state_prints(state, REVISION, TMODE_BOLD);
state_prints(state, "\r\n\r\n", 0);
+
+noheader:
state->text_updateall = true;
draw_update_screen(screen, state);
bool ctrl_p = (state & XK_Control_R) != 0;
bool shift_p = (state & (XK_Shift_L | XK_Shift_R)) != 0;
- if (shiftctrl && ctrl_p && shift_p)
+ if (shiftctrl != NULL && ctrl_p && shift_p)
return shiftctrl;
- if (shift && shift_p)
+ if (shift != NULL && shift_p)
return shift;
- if (ctrl && ctrl_p)
+ if (ctrl != NULL && ctrl_p)
return ctrl;
+
return norm;
}
/* Free any previous selection */
if (st->selected != NULL) {
+ (void)memset(st->selected, 0,
+ st->nselected * sizeof(uint32_t));
free(st->selected);
st->selected = NULL;
st->nselected = 0;