2 * Copyright (c) 2021 Omar Polo <op@omarpolo.com>
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 * Ncurses UI for telescope.
23 * ncurses allows you to scroll a window, but when a line goes out of
24 * the visible area it's forgotten. We keep a list of formatted lines
25 * (``visual lines'') that we know fits in the window, and draw them.
27 * This means that on every resize we have to clear our list of lines
28 * and re-render everything. A clever approach would be to do this
29 * ``on-demand'', but it's still missing.
45 #include "minibuffer.h"
47 #include "telescope.h"
51 static struct event stdioev, winchev;
53 static void restore_curs_x(struct buffer *);
55 static int readkey(void);
56 static void dispatch_stdio(int, short, void*);
57 static void handle_resize(int, short, void*);
58 static void handle_resize_nodelay(int, short, void*);
59 static void rearrange_windows(void);
60 static void line_prefix_and_text(struct vline *, char *, size_t, const char **, const char **);
61 static void print_vline(int, int, WINDOW*, struct vline*);
62 static void redraw_tabline(void);
63 static void redraw_window(WINDOW*, int, int, int, struct buffer*);
64 static void redraw_help(void);
65 static void redraw_body(struct tab*);
66 static void redraw_modeline(struct tab*);
67 static void redraw_minibuffer(void);
68 static void do_redraw_echoarea(void);
69 static void do_redraw_minibuffer(void);
70 static void do_redraw_minibuffer_compl(void);
71 static void place_cursor(int);
72 static void redraw_tab(struct tab*);
73 static void update_loading_anim(int, short, void*);
74 static void stop_loading_anim(struct tab*);
76 static int should_rearrange_windows;
77 static int show_tab_bar;
81 struct thiskey thiskey;
82 struct tab *current_tab;
84 static struct event resizeev;
85 static struct timeval resize_timer = { 0, 250000 };
87 static WINDOW *tabline, *body, *modeline, *echoarea, *minibuffer;
89 int body_lines, body_cols;
92 /* not static so we can see them from help.c */
93 struct buffer helpwin;
94 int help_lines, help_cols;
96 static int side_window;
97 static int in_side_window;
99 static struct timeval loadingev_timer = { 0, 250000 };
101 static char keybuf[64];
103 /* XXX: don't forget to init these in main() */
104 struct kmap global_map,
110 update_x_offset(void)
112 if (olivetti_mode && fill_column < body_cols)
113 x_offset = (body_cols - fill_column)/2;
119 save_excursion(struct excursion *place, struct buffer *buffer)
121 place->curs_x = buffer->curs_x;
122 place->curs_y = buffer->curs_y;
123 place->line_off = buffer->line_off;
124 place->top_line = buffer->top_line;
125 place->current_line = buffer->current_line;
126 place->cpoff = buffer->cpoff;
130 restore_excursion(struct excursion *place, struct buffer *buffer)
132 buffer->curs_x = place->curs_x;
133 buffer->curs_y = place->curs_y;
134 buffer->line_off = place->line_off;
135 buffer->top_line = place->top_line;
136 buffer->current_line = place->current_line;
137 buffer->cpoff = place->cpoff;
141 restore_curs_x(struct buffer *buffer)
144 const char *prfx, *text;
146 vl = buffer->current_line;
147 if (vl == NULL || vl->line == NULL)
148 buffer->curs_x = buffer->cpoff = 0;
149 else if (vl->parent->data != NULL) {
150 text = vl->parent->data;
151 buffer->curs_x = utf8_snwidth(text + 1, buffer->cpoff) + 1;
153 buffer->curs_x = utf8_snwidth(vl->line, buffer->cpoff);
155 buffer->curs_x += x_offset;
160 if (vl->parent->data != NULL)
161 buffer->curs_x += utf8_swidth_between(vl->parent->line,
164 prfx = line_prefixes[vl->parent->type].prfx1;
165 buffer->curs_x += utf8_swidth(prfx);
170 global_key_unbound(void)
172 message("%s is undefined", keybuf);
179 return &ministate.buffer;
182 return ¤t_tab->buffer;
190 if ((thiskey.key = wgetch(body)) == ERR)
193 thiskey.meta = thiskey.key == 27;
195 thiskey.key = wgetch(body);
196 if (thiskey.key == ERR || thiskey.key == 27) {
204 if ((unsigned int)thiskey.key >= UINT8_MAX)
208 if (!utf8_decode(&state, &thiskey.cp, (uint8_t)thiskey.key))
210 if ((thiskey.key = wgetch(body)) == ERR) {
211 message("Error decoding user input");
220 dispatch_stdio(int fd, short ev, void *d)
226 /* TODO: schedule a redraw? */
233 if (keybuf[0] != '\0')
234 strlcat(keybuf, " ", sizeof(keybuf));
236 strlcat(keybuf, "M-", sizeof(keybuf));
237 if (thiskey.cp != 0) {
238 utf8_encode(thiskey.cp, tmp);
239 strlcat(keybuf, tmp, sizeof(keybuf));
240 } else if ((keyname = unkbd(thiskey.key)) != NULL) {
241 strlcat(keybuf, keyname, sizeof(keybuf));
243 tmp[0] = thiskey.key;
244 strlcat(keybuf, tmp, sizeof(keybuf));
247 TAILQ_FOREACH(k, ¤t_map->m, keymaps) {
248 if (k->meta == thiskey.meta &&
249 k->key == thiskey.key) {
251 current_map = &k->map;
253 current_map = base_map;
254 strlcpy(keybuf, "", sizeof(keybuf));
255 k->fn(current_buffer());
261 if (current_map->unhandled_input != NULL)
262 current_map->unhandled_input();
264 global_key_unbound();
266 strlcpy(keybuf, "", sizeof(keybuf));
267 current_map = base_map;
273 if (should_rearrange_windows)
275 redraw_tab(current_tab);
279 handle_resize(int sig, short ev, void *d)
281 if (event_pending(&resizeev, EV_TIMEOUT, NULL)) {
282 event_del(&resizeev);
284 evtimer_set(&resizeev, handle_resize_nodelay, NULL);
285 evtimer_add(&resizeev, &resize_timer);
289 handle_resize_nodelay(int s, short ev, void *d)
299 should_show_tab_bar(void)
301 if (tab_bar_show == -1)
303 if (tab_bar_show == 0)
306 return TAILQ_NEXT(TAILQ_FIRST(&tabshead), tabs) != NULL;
310 rearrange_windows(void)
314 should_rearrange_windows = 0;
315 show_tab_bar = should_show_tab_bar();
319 /* 3 lines for the ui and 12 for the */
320 if ((too_small = lines < 15)) {
322 printw("Window too small.");
327 /* move and resize the windows, in reverse order! */
329 if (in_minibuffer == MB_COMPREAD) {
330 mvwin(minibuffer, lines-10, 0);
331 wresize(minibuffer, 10, COLS);
334 wrap_page(&ministate.compl.buffer, COLS);
337 mvwin(echoarea, --lines, 0);
338 wresize(echoarea, 1, COLS);
340 mvwin(modeline, --lines, 0);
341 wresize(modeline, 1, COLS);
343 body_lines = show_tab_bar ? --lines : lines;
347 * Here we make the assumption that show_tab_bar is either 0
348 * or 1, and reuse that as argument to mvwin.
351 help_cols = 0.3 * COLS;
353 mvwin(help, show_tab_bar, 0);
354 wresize(help, help_lines, help_cols);
356 wrap_page(&helpwin, help_cols);
358 body_cols = COLS - help_cols - 1;
359 mvwin(body, show_tab_bar, help_cols);
361 mvwin(body, show_tab_bar, 0);
364 wresize(body, body_lines, body_cols);
367 wresize(tabline, 1, COLS);
369 wrap_page(¤t_tab->buffer, body_cols);
370 redraw_tab(current_tab);
374 line_prefix_and_text(struct vline *vl, char *buf, size_t len,
375 const char **prfx_ret, const char **text_ret)
377 int type, i, cont, width;
380 if ((*text_ret = vl->line) == NULL)
383 cont = vl->flags & L_CONTINUATION;
384 type = vl->parent->type;
386 *prfx_ret = line_prefixes[type].prfx1;
388 *prfx_ret = line_prefixes[type].prfx2;
390 space = vl->parent->data;
391 if (!emojify_link || type != LINE_LINK || space == NULL)
396 width = utf8_swidth_between(vl->parent->line, space);
397 for (i = 0; i < width + 1; ++i)
398 strlcat(buf, " ", len);
400 strlcpy(buf, *text_ret, len);
401 if ((t = strchr(buf, ' ')) != NULL)
403 strlcat(buf, " ", len);
406 *text_ret += (space - vl->parent->line) + 1;
413 print_vline_descr(int width, WINDOW *window, struct vline *vl)
417 if (vl->parent->type != LINE_COMPL &&
418 vl->parent->type != LINE_COMPL_CURRENT &&
419 vl->parent->type != LINE_HELP)
422 if (vl->parent->alt == NULL)
428 if (vl->parent->type == LINE_HELP)
434 wprintw(window, " ");
435 for (; goal > x; ++x)
436 wprintw(window, " ");
438 wprintw(window, "%s", vl->parent->alt);
442 * Core part of the rendering. It prints a vline starting from the
443 * current cursor position. Printing a vline consists of skipping
444 * `off' columns (for olivetti-mode), print the correct prefix (which
445 * may be the emoji in case of emojified links-lines), printing the
446 * text itself, filling until width - off and filling off columns
450 print_vline(int off, int width, WINDOW *window, struct vline *vl)
453 * Believe me or not, I've seen emoji ten code points long!
454 * That means, to stay large, 4*10 bytes + NUL.
456 char emojibuf[41] = {0};
457 const char *text, *prfx;
461 f = &line_faces[vl->parent->type];
463 /* unused, set by getyx */
466 line_prefix_and_text(vl, emojibuf, sizeof(emojibuf), &prfx, &text);
468 wattr_on(window, body_face.left, NULL);
469 for (i = 0; i < off; i++)
471 wattr_off(window, body_face.left, NULL);
473 wattr_on(window, f->prefix, NULL);
474 wprintw(window, "%s", prfx);
475 wattr_off(window, f->prefix, NULL);
477 wattr_on(window, f->text, NULL);
478 wprintw(window, "%s", text);
479 print_vline_descr(width, window, vl);
480 wattr_off(window, f->text, NULL);
486 wattr_on(window, f->trail, NULL);
487 for (i = 0; i < left - off; ++i)
489 wattr_off(window, f->trail, NULL);
491 wattr_on(window, body_face.right, NULL);
492 for (i = 0; i < off; i++)
494 wattr_off(window, body_face.right, NULL);
502 size_t toskip, ots, tabwidth, space, x;
503 int current, y, truncated, pair;
509 /* unused, but setted by a getyx */
512 tabwidth = sizeof(buf)+1;
516 TAILQ_FOREACH(tab, &tabshead, tabs) {
518 if (tab == current_tab)
522 if (toskip * tabwidth < space)
527 while (toskip != 0 &&
528 (ots - toskip+1) * tabwidth < space)
533 wattr_on(tabline, tab_face.background, NULL);
534 wprintw(tabline, toskip == 0 ? " " : "<");
535 wattr_off(tabline, tab_face.background, NULL);
538 TAILQ_FOREACH(tab, &tabshead, tabs) {
546 getyx(tabline, y, x);
547 if (x + sizeof(buf)+2 >= (size_t)COLS)
550 current = tab == current_tab;
552 if (*(title = tab->buffer.page.title) == '\0')
553 title = tab->hist_cur->h;
555 if (tab->flags & TAB_URGENT)
556 strlcpy(buf, "!", sizeof(buf));
558 strlcpy(buf, " ", sizeof(buf));
560 if (strlcat(buf, title, sizeof(buf)) >= sizeof(buf)) {
561 /* truncation happens */
562 strlcpy(&buf[sizeof(buf)-4], "...", 4);
564 /* pad with spaces */
565 while (strlcat(buf, " ", sizeof(buf)) < sizeof(buf))
569 pair = current ? tab_face.current : tab_face.tab;
570 wattr_on(tabline, pair, NULL);
571 wprintw(tabline, "%s", buf);
572 wattr_off(tabline, pair, NULL);
574 wattr_on(tabline, tab_face.background, NULL);
575 if (TAILQ_NEXT(tab, tabs) != NULL)
576 wprintw(tabline, "┃");
577 wattr_off(tabline, tab_face.background, NULL);
580 wattr_on(tabline, tab_face.background, NULL);
581 for (; x < (size_t)COLS; ++x)
582 waddch(tabline, ' ');
584 mvwprintw(tabline, 0, COLS-1, ">");
585 wattr_off(tabline, tab_face.background, NULL);
589 * Compute the first visible line around vl. Try to search forward
590 * until the end of the buffer; if a visible line is not found, search
591 * backward. Return NULL if no viable line was found.
594 adjust_line(struct vline *vl, struct buffer *buffer)
601 if (!(vl->parent->flags & L_HIDDEN))
606 t != NULL && t->parent->flags & L_HIDDEN;
607 t = TAILQ_NEXT(t, vlines))
613 /* search backward */
615 t != NULL && t->parent->flags & L_HIDDEN;
616 t = TAILQ_PREV(t, vhead, vlines))
623 redraw_window(WINDOW *win, int off, int height, int width,
624 struct buffer *buffer)
629 restore_curs_x(buffer);
632 * TODO: ignoring buffer->force_update and always
633 * re-rendering. In theory we can recompute the y position
634 * without a re-render, and optimize here. It's not the only
635 * optimisation possible here, wscrl wolud also be an
643 if (TAILQ_EMPTY(&buffer->head))
646 if (buffer->top_line == NULL)
647 buffer->top_line = TAILQ_FIRST(&buffer->head);
649 buffer->top_line = adjust_line(buffer->top_line, buffer);
650 if (buffer->top_line == NULL)
653 buffer->current_line = adjust_line(buffer->current_line, buffer);
657 for (vl = buffer->top_line; vl != NULL; vl = TAILQ_NEXT(vl, vlines)) {
658 if (vl->parent->flags & L_HIDDEN)
662 print_vline(off, width, win, vl);
664 if (vl == buffer->current_line)
676 for (; vl != NULL; vl = TAILQ_NEXT(vl, vlines)) {
677 if (vl == buffer->current_line)
679 if (vl->parent->flags & L_HIDDEN)
682 buffer->top_line = TAILQ_NEXT(buffer->top_line, vlines);
689 buffer->last_line_off = buffer->line_off;
690 buffer->force_redraw = 0;
692 wmove(win, buffer->curs_y, buffer->curs_x);
698 redraw_window(help, 0, help_lines, help_cols, &helpwin);
702 redraw_body(struct tab *tab)
704 static struct tab *last_tab;
707 tab->buffer.force_redraw =1;
710 redraw_window(body, x_offset, body_lines, body_cols, &tab->buffer);
714 trust_status_char(enum trust_state ts)
717 case TS_UNKNOWN: return '-';
718 case TS_UNTRUSTED: return '!';
719 case TS_TEMP_TRUSTED: return '!';
720 case TS_TRUSTED: return 'v';
721 case TS_VERIFIED: return 'V';
727 redraw_modeline(struct tab *tab)
729 struct buffer *buffer;
731 int x, y, max_x, max_y;
733 const char *spin = "-\\|/";
735 buffer = current_buffer();
736 mode = buffer->page.name;
739 wattr_on(modeline, modeline_face.background, NULL);
740 wmove(modeline, 0, 0);
742 wprintw(modeline, "-%c%c %s ",
743 spin[tab->loading_anim_step],
744 trust_status_char(tab->trust),
745 mode == NULL ? "(none)" : mode);
747 pct = (buffer->line_off + buffer->curs_y) * 100.0
750 if (buffer->line_max <= (size_t)body_lines)
751 wprintw(modeline, "All ");
752 else if (buffer->line_off == 0)
753 wprintw(modeline, "Top ");
754 else if (buffer->line_off + body_lines >= buffer->line_max)
755 wprintw(modeline, "Bottom ");
757 wprintw(modeline, "%.0f%% ", pct);
759 wprintw(modeline, "%d/%d %s ",
760 buffer->line_off + buffer->curs_y,
764 getyx(modeline, y, x);
765 getmaxyx(modeline, max_y, max_x);
770 for (; x < max_x; ++x)
771 waddstr(modeline, "-");
773 wattr_off(modeline, modeline_face.background, NULL);
777 redraw_minibuffer(void)
779 wattr_on(echoarea, minibuffer_face.background, NULL);
783 do_redraw_minibuffer();
785 do_redraw_echoarea();
787 if (in_minibuffer == MB_COMPREAD)
788 do_redraw_minibuffer_compl();
790 wattr_off(echoarea, minibuffer_face.background, NULL);
794 do_redraw_echoarea(void)
798 if (ministate.curmesg != NULL)
799 wprintw(echoarea, "%s", ministate.curmesg);
800 else if (*keybuf != '\0')
801 waddstr(echoarea, keybuf);
803 /* If nothing else, show the URL at point */
804 vl = current_tab->buffer.current_line;
805 if (vl != NULL && vl->parent->type == LINE_LINK)
806 waddstr(echoarea, vl->parent->alt);
811 do_redraw_minibuffer(void)
813 struct buffer *cmplbuf, *buffer;
814 size_t off_y, off_x = 0;
815 const char *start, *c;
817 cmplbuf = &ministate.compl.buffer;
818 buffer = &ministate.buffer;
819 (void)off_y; /* unused, set by getyx */
821 wmove(echoarea, 0, 0);
823 if (in_minibuffer == MB_COMPREAD)
824 wprintw(echoarea, "(%2d) ",
827 wprintw(echoarea, "%s", ministate.prompt);
828 if (ministate.hist_cur != NULL)
829 wprintw(echoarea, "(%zu/%zu) ",
830 ministate.hist_off + 1,
831 ministate.history->len);
833 getyx(echoarea, off_y, off_x);
835 start = ministate.hist_cur != NULL
836 ? ministate.hist_cur->h
838 c = utf8_nth(buffer->current_line->line, buffer->cpoff);
839 while (utf8_swidth_between(start, c) > (size_t)COLS/2) {
840 start = utf8_next_cp(start);
843 waddstr(echoarea, start);
845 if (ministate.curmesg != NULL)
846 wprintw(echoarea, " [%s]", ministate.curmesg);
848 wmove(echoarea, 0, off_x + utf8_swidth_between(start, c));
852 do_redraw_minibuffer_compl(void)
854 redraw_window(minibuffer, 0, 10, COLS,
855 &ministate.compl.buffer);
859 * Place the cursor in the right ncurses window. If soft is 1, use
860 * wnoutrefresh (which shouldn't cause any I/O); otherwise use
864 place_cursor(int soft)
866 int (*touch)(WINDOW *);
869 touch = wnoutrefresh;
878 } else if (in_side_window) {
891 redraw_tab(struct tab *tab)
905 redraw_modeline(tab);
908 wnoutrefresh(tabline);
909 wnoutrefresh(modeline);
911 if (in_minibuffer == MB_COMPREAD)
912 wnoutrefresh(minibuffer);
919 dprintf(1, "\033]2;%s - Telescope\a",
920 current_tab->buffer.page.title);
924 start_loading_anim(struct tab *tab)
926 if (tab->loading_anim)
928 tab->loading_anim = 1;
929 evtimer_set(&tab->loadingev, update_loading_anim, tab);
930 evtimer_add(&tab->loadingev, &loadingev_timer);
934 update_loading_anim(int fd, short ev, void *d)
938 tab->loading_anim_step = (tab->loading_anim_step+1)%4;
940 if (tab == current_tab) {
941 redraw_modeline(tab);
948 evtimer_add(&tab->loadingev, &loadingev_timer);
952 stop_loading_anim(struct tab *tab)
954 if (!tab->loading_anim)
956 evtimer_del(&tab->loadingev);
957 tab->loading_anim = 0;
958 tab->loading_anim_step = 0;
960 if (tab != current_tab)
963 redraw_modeline(tab);
972 ui_print_colors(void)
974 int colors = 0, pairs = 0, can_change = 0;
975 int columns = 16, lines, color, i, j;
980 use_default_colors();
984 can_change = can_change_color();
988 printf("Term info:\n");
989 printf("TERM=%s COLORS=%d COLOR_PAIRS=%d can_change_colors=%d\n",
990 getenv("TERM"), colors, pairs, can_change);
994 printf("No color support\n");
998 printf("Available colors:\n\n");
999 lines = (colors - 1) / columns + 1;
1001 for (i = 0; i < lines; ++i) {
1002 for (j = 0; j < columns; ++j, ++color) {
1003 printf("\033[0;38;5;%dm %03d", color, color);
1016 setlocale(LC_ALL, "");
1018 if (TAILQ_EMPTY(&global_map.m)) {
1019 fprintf(stderr, "no keys defined!\n");
1025 /* initialize help window */
1026 TAILQ_INIT(&helpwin.head);
1027 TAILQ_INIT(&helpwin.page.head);
1029 base_map = &global_map;
1030 current_map = &global_map;
1034 if (enable_colors) {
1037 use_default_colors();
1042 config_apply_style();
1047 intrflush(stdscr, FALSE);
1049 if ((tabline = newwin(1, 1, 0, 0)) == NULL)
1051 if ((body = newwin(1, 1, 0, 0)) == NULL)
1053 if ((modeline = newwin(1, 1, 0, 0)) == NULL)
1055 if ((echoarea = newwin(1, 1, 0, 0)) == NULL)
1057 if ((minibuffer = newwin(1, 1, 0, 0)) == NULL)
1059 if ((help = newwin(1, 1, 0, 0)) == NULL)
1062 wbkgd(body, body_face.body);
1063 wbkgd(echoarea, minibuffer_face.background);
1068 scrollok(body, FALSE);
1070 /* non-blocking input */
1074 mvwprintw(body, 0, 0, "");
1076 evtimer_set(&resizeev, handle_resize, NULL);
1078 event_set(&stdioev, 0, EV_READ | EV_PERSIST, dispatch_stdio, NULL);
1079 event_add(&stdioev, NULL);
1081 signal_set(&winchev, SIGWINCH, handle_resize, NULL);
1082 signal_add(&winchev, NULL);
1090 switch_to_tab(current_tab);
1091 rearrange_windows();
1097 ui_on_tab_loaded(struct tab *tab)
1099 stop_loading_anim(tab);
1100 message("Loaded %s", tab->hist_cur->h);
1110 ui_on_tab_refresh(struct tab *tab)
1112 wrap_page(&tab->buffer, body_cols);
1113 if (tab == current_tab)
1116 tab->flags |= TAB_URGENT;
1126 ui_toggle_side_window(void)
1128 side_window = !side_window;
1135 * ugly hack, but otherwise the window doesn't get updated
1136 * until I call rearrange_windows a second time (e.g. via
1137 * C-l). I will be happy to know why something like this is
1140 rearrange_windows();
1141 rearrange_windows();
1145 ui_schedule_redraw(void)
1147 should_rearrange_windows = 1;
1151 ui_require_input(struct tab *tab, int hide, int proto)
1155 if (proto == PROTO_GEMINI)
1156 fn = ir_select_gemini;
1157 else if (proto == PROTO_GOPHER)
1158 fn = ir_select_gopher;
1162 /* TODO: hard-switching to another tab is ugly */
1165 enter_minibuffer(sensible_self_insert, fn, exit_minibuffer,
1166 &ir_history, NULL, NULL);
1167 strlcpy(ministate.prompt, "Input required: ",
1168 sizeof(ministate.prompt));
1173 ui_after_message_hook(void)
1175 redraw_minibuffer();
1180 ui_yornp(const char *prompt, void (*fn)(int, struct tab *),
1183 yornp(prompt, fn, data);
1184 redraw_tab(current_tab);
1188 ui_read(const char *prompt, void (*fn)(const char*, struct tab *),
1189 struct tab *data, const char *input)
1191 minibuffer_read(prompt, fn, data);
1193 if (input != NULL) {
1194 strlcpy(ministate.buf, input, sizeof(ministate.buf));
1195 cmd_move_end_of_line(&ministate.buffer);
1198 redraw_tab(current_tab);
1202 ui_other_window(void)
1205 in_side_window = !in_side_window;
1207 message("No other window to select");
1215 kill(getpid(), SIGSTOP);
1219 rearrange_windows();