Codebergdnkl
foot
master
1#pragma once
3#include <stdint.h>
4#include <stdbool.h>
5#include <stddef.h>
7#include <threads.h>
8#include <semaphore.h>
10#if defined(FOOT_GRAPHEME_CLUSTERING)
11 #include <utf8proc.h>
12#endif
14#include <tllist.h>
15#include <fcft/fcft.h>
17#include "composed.h"
18#include "config.h"
19#include "debug.h"
20#include "fdm.h"
21#include "key-binding.h"
22#include "macros.h"
23#include "notify.h"
24#include "reaper.h"
25#include "shm.h"
26#include "wayland.h"
28enum color_source {
29 COLOR_DEFAULT,
30 COLOR_BASE16,
31 COLOR_BASE256,
32 COLOR_RGB,
33};
35/*
36 * Note: we want the cells to be as small as possible. Larger cells
37 * means fewer scrollback lines (or performance drops due to cache
38 * misses)
39 *
40 * Note that the members are laid out optimized for x86
41 */
42struct attributes {
43 bool bold:1;
44 bool dim:1;
45 bool italic:1;
46 bool underline:1;
47 bool strikethrough:1;
48 bool blink:1;
49 bool conceal:1;
50 bool reverse:1;
51 uint32_t fg:24;
53 bool clean:1;
54 enum color_source fg_src:2;
55 enum color_source bg_src:2;
56 bool confined:1;
57 bool selected:1;
58 bool url:1;
59 uint32_t bg:24;
60};
61static_assert(sizeof(struct attributes) == 8, "VT attribute struct too large");
63/* Last valid Unicode code point is 0x0010FFFFul */
64#define CELL_COMB_CHARS_LO 0x00200000ul
65#define CELL_COMB_CHARS_HI (CELL_COMB_CHARS_LO + 0x3fffffff)
66#define CELL_SPACER (CELL_COMB_CHARS_HI + 1)
68struct cell {
69 char32_t wc;
70 struct attributes attrs;
71};
72static_assert(sizeof(struct cell) == 12, "bad size");
74struct scroll_region {
75 int start;
76 int end;
77};
79struct coord {
80 int col;
81 int row;
82};
84struct range {
85 struct coord start;
86 struct coord end;
87};
89struct cursor {
90 struct coord point;
91 bool lcf; /* Last Column Flag; https://github.com/mattiase/wraptest#basic-vt-line-wrapping-rules */
92};
94enum damage_type {DAMAGE_SCROLL, DAMAGE_SCROLL_REVERSE,
95 DAMAGE_SCROLL_IN_VIEW, DAMAGE_SCROLL_REVERSE_IN_VIEW};
97struct damage {
98 enum damage_type type;
99 struct scroll_region region;
100 uint16_t lines;
101};
103struct uri_range_data {
104 uint64_t id;
105 char *uri;
106};
108struct underline_range_data {
109 enum underline_style style;
110 enum color_source color_src;
111 uint32_t color;
112};
114union row_range_data {
115 struct uri_range_data uri;
116 struct underline_range_data underline;
117};
119struct row_range {
120 int start;
121 int end;
123 union {
124 /* This is just an expanded union row_range_data, but
125 * anonymous, so that we don't have to write range->u.uri.id,
126 * but can instead do range->uri.id */
127 union {
128 struct uri_range_data uri;
129 struct underline_range_data underline;
130 };
131 union row_range_data data;
132 };
133};
135struct row_ranges {
136 struct row_range *v;
137 int size;
138 int count;
139};
141enum row_range_type {ROW_RANGE_URI, ROW_RANGE_UNDERLINE};
143struct row_data {
144 struct row_ranges uri_ranges;
145 struct row_ranges underline_ranges;
146};
148struct row {
149 struct cell *cells;
150 struct row_data *extra;
152 bool dirty;
153 bool linebreak;
155 struct {
156 bool prompt_marker;
157 int cmd_start; /* Column, -1 if unset */
158 int cmd_end; /* Column, -1 if unset */
159 } shell_integration;
160};
162struct sixel {
163 /*
164 * These three members reflect the "current", maybe scaled version
165 * of the image.
166 *
167 * The values will either be NULL/-1/-1, or match either the
168 * values in "original", or "scaled".
169 *
170 * They are typically reset when we need to invalidate the cached
171 * version (e.g. when the cell dimensions change).
172 */
173 pixman_image_t *pix;
174 int width;
175 int height;
177 int rows;
178 int cols;
179 struct coord pos;
180 bool opaque;
182 /*
183 * We store the cell dimensions of the time the sixel was emitted.
184 *
185 * If the font size is changed, we rescale the image accordingly,
186 * to ensure it stays within its cell boundaries. 'scaled' is a
187 * cached, rescaled version of 'data' + 'pix'.
188 */
189 int cell_width;
190 int cell_height;
192 struct {
193 void *data;
194 pixman_image_t *pix;
195 int width;
196 int height;
197 } original;
199 struct {
200 void *data;
201 pixman_image_t *pix;
202 int width;
203 int height;
204 } scaled;
205};
207enum kitty_kbd_flags {
208 KITTY_KBD_DISAMBIGUATE = 0x01,
209 KITTY_KBD_REPORT_EVENT = 0x02,
210 KITTY_KBD_REPORT_ALTERNATE = 0x04,
211 KITTY_KBD_REPORT_ALL = 0x08,
212 KITTY_KBD_REPORT_ASSOCIATED = 0x10,
213 KITTY_KBD_SUPPORTED = (KITTY_KBD_DISAMBIGUATE |
214 KITTY_KBD_REPORT_EVENT |
215 KITTY_KBD_REPORT_ALTERNATE |
216 KITTY_KBD_REPORT_ALL |
217 KITTY_KBD_REPORT_ASSOCIATED),
218};
220struct grid {
221 int num_rows;
222 int num_cols;
223 int offset;
224 int view;
226 /*
227 * Note: the cursor (not the *saved* cursor) could most likely be
228 * global state in the term struct.
229 *
230 * However, we have grid specific functions that does not have
231 * access to the owning term struct, but does need access to the
232 * cursor.
233 */
234 struct cursor cursor;
235 struct cursor saved_cursor;
236 struct attributes saved_attrs;
238 struct row **rows;
239 struct row *cur_row;
241 tll(struct damage) scroll_damage;
242 tll(struct sixel) sixel_images;
244 struct {
245 enum kitty_kbd_flags flags[8];
246 uint8_t idx;
247 } kitty_kbd;
249};
251struct vt_subparams {
252 uint8_t idx;
253 unsigned *cur;
254 unsigned value[16];
255 unsigned dummy;
256};
258struct vt_param {
259 unsigned value;
260 struct vt_subparams sub;
261};
263struct vt {
264 int state; /* enum state */
265 char32_t last_printed;
266#if defined(FOOT_GRAPHEME_CLUSTERING)
267 utf8proc_int32_t grapheme_state;
268 bool codepoint_merging_ok;
269#endif
270 char32_t utf8;
271 struct {
272 uint8_t idx;
273 struct vt_param *cur;
274 struct vt_param v[16];
275 struct vt_param dummy;
276 } params;
278 uint32_t private; /* LSB=priv0, MSB=priv3 */
280 struct attributes attrs;
282 struct {
283 uint8_t *data;
284 size_t size;
285 size_t idx;
286 bool bel; /* true if OSC string was terminated by BEL */
287 } osc;
289 /* Start coordinate for current OSC-8 URI */
290 struct {
291 uint64_t id;
292 char *uri;
293 } osc8;
295 struct underline_range_data underline;
297 struct {
298 uint8_t *data;
299 size_t size;
300 size_t idx;
301 void (*put_handler)(struct terminal *term, uint8_t c);
302 void (*unhook_handler)(struct terminal *term);
303 } dcs;
304};
306enum cursor_origin { ORIGIN_ABSOLUTE, ORIGIN_RELATIVE };
307enum cursor_keys { CURSOR_KEYS_DONTCARE, CURSOR_KEYS_NORMAL, CURSOR_KEYS_APPLICATION };
308enum keypad_keys { KEYPAD_DONTCARE, KEYPAD_NUMERICAL, KEYPAD_APPLICATION };
309enum charset { CHARSET_ASCII, CHARSET_GRAPHIC };
310enum charset_designator { G0, G1, G2, G3 };
312struct charsets {
313 enum charset_designator selected;
314 enum charset_designator saved;
315 enum charset set[4]; /* G0-G3 */
316};
318/* *What* to report */
319enum mouse_tracking {
320 MOUSE_NONE,
321 MOUSE_X10, /* ?9h */
322 MOUSE_CLICK, /* ?1000h - report mouse clicks */
323 MOUSE_DRAG, /* ?1002h - report clicks and drag motions */
324 MOUSE_MOTION, /* ?1003h - report clicks and motion */
325};
327/* *How* to report */
328enum mouse_reporting {
329 MOUSE_NORMAL,
330 MOUSE_UTF8, /* ?1005h */
331 MOUSE_SGR, /* ?1006h */
332 MOUSE_URXVT, /* ?1015h */
333 MOUSE_SGR_PIXELS, /* ?1016h */
334};
336enum selection_kind {
337 SELECTION_NONE,
338 SELECTION_CHAR_WISE,
339 SELECTION_WORD_WISE,
340 SELECTION_QUOTE_WISE,
341 SELECTION_LINE_WISE,
342 SELECTION_BLOCK
343};
344enum selection_direction {SELECTION_UNDIR, SELECTION_LEFT, SELECTION_RIGHT};
345enum selection_scroll_direction {SELECTION_SCROLL_NOT, SELECTION_SCROLL_UP, SELECTION_SCROLL_DOWN};
346enum search_direction { SEARCH_BACKWARD_SAME_POSITION, SEARCH_BACKWARD, SEARCH_FORWARD };
348struct ptmx_buffer {
349 void *data;
350 size_t len;
351 size_t idx;
352};
354enum term_surface {
355 TERM_SURF_NONE,
356 TERM_SURF_GRID,
357 TERM_SURF_TITLE,
358 TERM_SURF_BORDER_LEFT,
359 TERM_SURF_BORDER_RIGHT,
360 TERM_SURF_BORDER_TOP,
361 TERM_SURF_BORDER_BOTTOM,
362 TERM_SURF_BUTTON_MINIMIZE,
363 TERM_SURF_BUTTON_MAXIMIZE,
364 TERM_SURF_BUTTON_CLOSE,
365};
367enum overlay_style {
368 OVERLAY_NONE,
369 OVERLAY_SEARCH,
370 OVERLAY_FLASH,
371 OVERLAY_UNICODE_MODE,
372};
374typedef tll(struct ptmx_buffer) ptmx_buffer_list_t;
376enum url_action { URL_ACTION_COPY, URL_ACTION_LAUNCH, URL_ACTION_PERSISTENT };
377struct url {
378 uint64_t id;
379 char *url;
380 char32_t *key;
381 struct range range;
382 enum url_action action;
383 bool url_mode_dont_change_url_attr; /* Entering/exiting URL mode doesn't touch the cells' attr.url */
384 bool osc8;
385 bool duplicate;
386};
387typedef tll(struct url) url_list_t;
390struct colors {
391 uint32_t fg;
392 uint32_t bg;
393 uint32_t table[256];
394 uint16_t alpha;
395 uint32_t cursor_fg; /* Text color */
396 uint32_t cursor_bg; /* cursor color */
397 uint32_t selection_fg;
398 uint32_t selection_bg;
399 enum which_color_theme active_theme;
400};
402struct terminal {
403 struct fdm *fdm;
404 struct reaper *reaper;
405 const struct config *conf;
407 void (*ascii_printer)(struct terminal *term, char32_t c);
408 union {
409 struct {
410 bool sixels:1;
411 bool osc8:1;
412 bool underline_style:1;
413 bool underline_color:1;
414 bool insert_mode:1;
415 bool charset:1;
416 };
417 uint8_t value;
418 } bits_affecting_ascii_printer;
420 pid_t slave;
421 int ptmx;
423 struct vt vt;
424 struct grid *grid;
425 struct grid normal;
426 struct grid alt;
428 int cols; /* number of columns */
429 int rows; /* number of rows */
430 struct scroll_region scroll_region;
432 struct charsets charsets;
433 struct charsets saved_charsets; /* For save/restore cursor + attributes */
435 bool auto_margin;
436 bool insert_mode;
437 bool reverse;
438 bool hide_cursor;
439 bool reverse_wrap;
440 bool bracketed_paste;
441 bool focus_events;
442 bool visibility_reports;
443 bool alt_scrolling;
444 bool modify_other_keys_2; /* True when modifyOtherKeys=2 (i.e. "CSI >4;2m") */
445 enum cursor_origin origin;
446 enum cursor_keys cursor_keys_mode;
447 enum keypad_keys keypad_keys_mode;
448 enum mouse_tracking mouse_tracking;
449 enum mouse_reporting mouse_reporting;
450 char *mouse_user_cursor; /* For OSC-22 */
452 tll(int) tab_stops;
454 size_t composed_count;
455 struct composed *composed;
457 /* Temporary: for FDM */
458 struct {
459 bool is_armed;
460 int lower_fd;
461 int upper_fd;
462 } delayed_render_timer;
464 struct fcft_font *fonts[4];
465 struct config_font *font_sizes[4];
466 struct pt_or_px font_line_height;
467 float font_dpi;
468 float font_dpi_before_unmap;
469 bool font_is_sized_by_dpi;
470 int16_t font_x_ofs;
471 int16_t font_y_ofs;
472 int16_t font_baseline;
473 enum fcft_subpixel font_subpixel;
475 struct {
476 struct fcft_glyph **box_drawing;
477 struct fcft_glyph **braille;
478 struct fcft_glyph **octants;
479 struct fcft_glyph **legacy;
481 #define GLYPH_BOX_DRAWING_FIRST 0x2500
482 #define GLYPH_BOX_DRAWING_LAST 0x259F
483 #define GLYPH_BOX_DRAWING_COUNT \
484 (GLYPH_BOX_DRAWING_LAST - GLYPH_BOX_DRAWING_FIRST + 1)
486 #define GLYPH_BRAILLE_FIRST 0x2800
487 #define GLYPH_BRAILLE_LAST 0x28FF
488 #define GLYPH_BRAILLE_COUNT \
489 (GLYPH_BRAILLE_LAST - GLYPH_BRAILLE_FIRST + 1)
491 #define GLYPH_OCTANTS_FIRST 0x1CD00
492 #define GLYPH_OCTANTS_LAST 0x1CDE5
493 #define GLYPH_OCTANTS_COUNT \
494 (GLYPH_OCTANTS_LAST - GLYPH_OCTANTS_FIRST + 1)
496 #define GLYPH_LEGACY_FIRST 0x1FB00
497 #define GLYPH_LEGACY_LAST 0x1FB9B
498 #define GLYPH_LEGACY_COUNT \
499 (GLYPH_LEGACY_LAST - GLYPH_LEGACY_FIRST + 1)
500 } custom_glyphs;
502 bool is_sending_paste_data;
503 ptmx_buffer_list_t ptmx_buffers;
504 ptmx_buffer_list_t ptmx_paste_buffers;
506 struct {
507 bool esc_prefix;
508 bool eight_bit;
509 } meta;
511 bool num_lock_modifier;
512 bool bell_action_enabled;
513 bool report_theme_changes;
515 /* Saved DECSET modes - we save the SET state */
516 struct {
517 bool origin:1;
518 bool application_cursor_keys:1;
519 bool application_keypad_keys:1;
520 bool reverse:1;
521 bool show_cursor:1;
522 bool reverse_wrap:1;
523 bool auto_margin:1;
524 bool cursor_blink:1;
525 bool bracketed_paste:1;
526 bool focus_events:1;
527 bool visibility_reports:1;
528 bool alt_scrolling:1;
529 //bool mouse_x10:1;
530 bool mouse_click:1;
531 bool mouse_drag:1;
532 bool mouse_motion:1;
533 //bool mouse_utf8:1;
534 bool mouse_sgr:1;
535 bool mouse_urxvt:1;
536 bool mouse_sgr_pixels:1;
537 bool meta_eight_bit:1;
538 bool meta_esc_prefix:1;
539 bool num_lock_modifier:1;
540 bool bell_action_enabled:1;
541 bool alt_screen:1;
542 bool ime:1;
543 bool app_sync_updates:1;
544 bool grapheme_shaping:1;
545 bool report_theme_changes:1;
547 bool size_notifications:1;
549 bool sixel_display_mode:1;
550 bool sixel_private_palette:1;
551 bool sixel_cursor_right_of_graphics:1;
552 } xtsave;
554 bool window_title_has_been_set;
555 char *window_title;
556 tll(char *) window_title_stack;
557 //char *window_icon; /* No escape sequence available to set the icon */
558 //tll(char *)window_icon_stack;
559 char *app_id;
561 struct {
562 bool active;
563 int fd;
564 } flash;
566 struct {
567 enum { BLINK_ON, BLINK_OFF } state;
568 int fd;
569 } blink;
571 float scale;
572 float scale_before_unmap; /* Last scaling factor used */
573 int width; /* pixels */
574 int height; /* pixels */
575 int stashed_width;
576 int stashed_height;
577 struct {
578 int left;
579 int right;
580 int top;
581 int bottom;
582 } margins;
583 int cell_width; /* pixels per cell, x-wise */
584 int cell_height; /* pixels per cell, y-wise */
586 struct colors colors;
588 struct {
589 struct colors *stack;
590 size_t idx;
591 size_t size;
592 } color_stack;
594 enum cursor_style cursor_style;
595 struct {
596 bool decset; /* Blink enabled via '\E[?12h' */
597 bool deccsusr; /* Blink enabled via '\E[X q' */
598 int fd;
599 enum { CURSOR_BLINK_ON, CURSOR_BLINK_OFF } state;
600 } cursor_blink;
602 struct {
603 enum selection_kind kind;
604 enum selection_direction direction;
605 struct range coords;
606 bool ongoing;
607 bool spaces_only; /* SELECTION_SEMANTIC_WORD */
609 struct range pivot;
611 struct {
612 int fd;
613 int col;
614 enum selection_scroll_direction direction;
615 } auto_scroll;
616 } selection;
618 bool is_searching;
619 struct {
620 char32_t *buf;
621 size_t len;
622 size_t sz;
623 size_t cursor;
625 int original_view;
626 bool view_followed_offset;
627 struct coord match;
628 size_t match_len;
630 struct {
631 char32_t *buf;
632 size_t len;
633 } last;
634 } search;
636 struct wayland *wl;
637 struct wl_window *window;
638 bool visual_focus;
639 bool kbd_focus;
640 enum term_surface active_surface;
642 struct {
643 struct {
644 struct buffer_chain *grid;
645 struct buffer_chain *search;
646 struct buffer_chain *scrollback_indicator;
647 struct buffer_chain *render_timer;
648 struct buffer_chain *url;
649 struct buffer_chain *csd;
650 struct buffer_chain *overlay;
651 } chains;
653 /* Scheduled for rendering, as soon-as-possible */
654 struct {
655 bool grid;
656 bool csd;
657 bool search;
658 bool urls;
659 } refresh;
661 /* Scheduled for rendering, in the next frame callback */
662 struct {
663 bool grid;
664 bool csd;
665 bool search;
666 bool urls;
667 } pending;
669 bool margins; /* Someone explicitly requested a refresh of the margins */
670 bool urgency; /* Signal 'urgency' (paint borders red) */
672 struct {
673 struct timespec last_update;
674 int timer_fd;
675 } title;
677 struct {
678 struct timespec last_update;
679 int timer_fd;
680 } icon;
682 struct {
683 struct timespec last_update;
684 int timer_fd;
685 } app_id;
687 uint32_t scrollback_lines; /* Number of scrollback lines, from conf (TODO: move out from render struct?) */
689 struct {
690 bool enabled;
691 int timer_fd;
692 } app_sync_updates;
694 /* Render threads + synchronization primitives */
695 struct {
696 uint16_t count;
697 sem_t start;
698 sem_t done;
699 mtx_t lock;
700 tll(int) queue;
701 thrd_t *threads;
702 struct buffer *buf;
704 struct {
705 mtx_t lock;
706 cnd_t cond;
707 struct buffer *buf;
708 struct timespec start;
709 struct timespec stop;
710 } preapplied_damage;
711 } workers;
713 /* Last rendered cursor position */
714 struct {
715 struct row *row;
716 int col;
717 bool hidden;
718 } last_cursor;
720 struct buffer *last_buf; /* Buffer we rendered to last time */
721 size_t frames_since_last_immediate_release;
722 bool preapply_last_frame_damage;
724 enum overlay_style last_overlay_style;
725 struct buffer *last_overlay_buf;
726 pixman_region32_t last_overlay_clip;
728 size_t search_glyph_offset;
730 struct timespec input_time;
731 } render;
733 struct {
734 struct grid *grid; /* Original 'normal' grid, before resize started */
735 int old_screen_rows; /* term->rows before resize started */
736 int old_cols; /* term->cols before resize started */
737 int old_hide_cursor; /* term->hide_cursor before resize started */
738 int new_rows; /* New number of scrollback rows */
739 struct range selection_coords;
740 } interactive_resizing;
742 struct {
743 enum {
744 SIXEL_DECSIXEL, /* DECSIXEL body part ", $, -, ? ... ~ */
745 SIXEL_DECGRA, /* DECGRA Set Raster Attributes " Pan; Pad; Ph; Pv */
746 SIXEL_DECGRI, /* DECGRI Graphics Repeat Introducer ! Pn Ch */
747 SIXEL_DECGCI, /* DECGCI Graphics Color Introducer # Pc; Pu; Px; Py; Pz */
748 } state;
750 struct coord pos; /* Current sixel coordinate */
751 int color_idx; /* Current palette index */
752 uint32_t *private_palette; /* Private palette, used when private mode 1070 is enabled */
753 uint32_t *shared_palette; /* Shared palette, used when private mode 1070 is disabled */
754 uint32_t *palette; /* Points to either private_palette or shared_palette */
755 uint32_t color;
757 struct {
758 uint32_t *data; /* Raw image data, in ARGB */
759 uint32_t *p; /* Pointer into data, for current position */
760 int width; /* Image width, in pixels */
761 int height; /* Image height, in pixels */
762 int alloc_height;
763 unsigned int bottom_pixel;
764 } image;
766 /*
767 * Pan is the vertical shape of a pixel
768 * Pad is the horizontal shape of a pixel
769 *
770 * pan/pad is the sixel's aspect ratio
771 */
772 int pan;
773 int pad;
775 bool scrolling:1; /* Private mode 80 */
776 bool use_private_palette:1; /* Private mode 1070 */
777 bool cursor_right_of_graphics:1; /* Private mode 8452 */
779 unsigned params[5]; /* Collected parameters, for RASTER, COLOR_SPEC */
780 unsigned param; /* Currently collecting parameter, for RASTER, COLOR_SPEC and REPEAT */
781 unsigned param_idx; /* Parameters seen */
782 unsigned repeat_count;
784 bool transparent_bg;
786 bool linear_blending;
787 bool use_10bit;
788 pixman_format_code_t pixman_fmt;
790 /* Application configurable */
791 unsigned palette_size; /* Number of colors in palette */
792 unsigned max_width; /* Maximum image width, in pixels */
793 unsigned max_height; /* Maximum image height, in pixels */
794 } sixel;
796 struct {
797 url_list_t list;
798 char32_t keys[5];
799 bool show_uri_on_jump_label;
800 struct grid *grid_snapshot;
801 bool ime_reenable_after_url_mode;
802 const struct config_spawn_template *launch;
803 } url;
805#if defined(FOOT_IME_ENABLED) && FOOT_IME_ENABLED
806 bool ime_enabled;
807#endif
809 struct {
810 bool active;
811 int count;
812 char32_t character;
813 } unicode_mode;
815 struct {
816 bool in_progress;
817 bool client_has_terminated;
818 int terminate_timeout_fd;
819 int exit_status;
820 int next_signal;
822 void (*cb)(void *data, int exit_code);
823 void *cb_data;
824 } shutdown;
826 /* State, to handle chunked notifications */
827 struct notification kitty_notification;
829 /* Currently active notifications, from foot's perspective (their
830 notification helper processes are still running) */
831 tll(struct notification) active_notifications;
832 struct notification_icon notification_icons[32];
834 char *foot_exe;
835 char *cwd;
837 bool grapheme_shaping;
838 bool size_notifications;
839};
841struct config;
842struct terminal *term_init(
843 const struct config *conf, struct fdm *fdm, struct reaper *reaper,
844 struct wayland *wayl, const char *foot_exe, const char *cwd,
845 const char *token, const char *pty_path,
846 int argc, char *const *argv, const char *const *envp,
847 void (*shutdown_cb)(void *data, int exit_code), void *shutdown_data);
849bool term_shutdown(struct terminal *term);
850int term_destroy(struct terminal *term);
852void term_update_ascii_printer(struct terminal *term);
853void term_single_shift(struct terminal *term, enum charset_designator idx);
855void term_reset(struct terminal *term, bool hard);
856bool term_to_slave(struct terminal *term, const void *data, size_t len);
857bool term_paste_data_to_slave(
858 struct terminal *term, const void *data, size_t len);
860bool term_fractional_scaling(const struct terminal *term);
861bool term_preferred_buffer_scale(const struct terminal *term);
862bool term_update_scale(struct terminal *term);
863bool term_font_size_increase(struct terminal *term);
864bool term_font_size_decrease(struct terminal *term);
865bool term_font_size_reset(struct terminal *term);
866bool term_font_dpi_changed(struct terminal *term, float old_scale);
867void term_font_subpixel_changed(struct terminal *term);
868int term_font_baseline(const struct terminal *term);
870int term_pt_or_px_as_pixels(
871 const struct terminal *term, const struct pt_or_px *pt_or_px);
874void term_window_configured(struct terminal *term);
876void term_damage_rows(struct terminal *term, int start, int end);
877void term_damage_rows_in_view(struct terminal *term, int start, int end);
879void term_damage_all(struct terminal *term);
880void term_damage_view(struct terminal *term);
882void term_damage_cursor(struct terminal *term);
883void term_damage_margins(struct terminal *term);
884void term_damage_color(struct terminal *term, enum color_source src, int idx);
886void term_reset_view(struct terminal *term);
888void term_damage_scroll(
889 struct terminal *term, enum damage_type damage_type,
890 struct scroll_region region, int lines);
892void term_erase(
893 struct terminal *term,
894 int start_row, int start_col,
895 int end_row, int end_col);
896void term_erase_scrollback(struct terminal *term);
898int term_row_rel_to_abs(const struct terminal *term, int row);
899void term_cursor_home(struct terminal *term);
900void term_cursor_to(struct terminal *term, int row, int col);
901void term_cursor_col(struct terminal *term, int col);
902void term_cursor_left(struct terminal *term, int count);
903void term_cursor_right(struct terminal *term, int count);
904void term_cursor_up(struct terminal *term, int count);
905void term_cursor_down(struct terminal *term, int count);
906void term_cursor_blink_update(struct terminal *term);
908void term_process_and_print_non_ascii(struct terminal *term, char32_t wc);
909void term_print(struct terminal *term, char32_t wc, int width,
910 bool insert_mode_disable);
911void term_fill(struct terminal *term, int row, int col, uint8_t c, size_t count,
912 bool use_sgr_attrs);
914void term_scroll(struct terminal *term, int rows);
915void term_scroll_reverse(struct terminal *term, int rows);
917void term_scroll_partial(
918 struct terminal *term, struct scroll_region region, int rows);
919void term_scroll_reverse_partial(
920 struct terminal *term, struct scroll_region region, int rows);
922void term_carriage_return(struct terminal *term);
923void term_linefeed(struct terminal *term);
924void term_reverse_index(struct terminal *term);
926void term_arm_blink_timer(struct terminal *term);
928void term_save_cursor(struct terminal *term);
929void term_restore_cursor(struct terminal *term, const struct cursor *cursor);
931void term_visual_focus_in(struct terminal *term);
932void term_visual_focus_out(struct terminal *term);
933void term_send_visibility_report(struct terminal *term);
934void term_kbd_focus_in(struct terminal *term);
935void term_kbd_focus_out(struct terminal *term);
936void term_mouse_down(
937 struct terminal *term, int button, int row, int col,
938 int row_pixels, int col_pixels,
939 bool shift, bool alt, bool ctrl);
940void term_mouse_up(
941 struct terminal *term, int button, int row, int col,
942 int row_pixels, int col_pixels,
943 bool shift, bool alt, bool ctrl);
944void term_mouse_motion(
945 struct terminal *term, int button, int row, int col,
946 int row_pixels, int col_pixels,
947 bool shift, bool alt, bool ctrl);
948bool term_mouse_grabbed(const struct terminal *term, const struct seat *seat);
949void term_xcursor_update(struct terminal *term);
950void term_xcursor_update_for_seat(struct terminal *term, struct seat *seat);
951void term_set_user_mouse_cursor(struct terminal *term, const char *cursor);
953void term_set_window_title(struct terminal *term, const char *title);
954void term_set_app_id(struct terminal *term, const char *app_id);
955const char *term_icon(const struct terminal *term);
956void term_flash(struct terminal *term, unsigned duration_ms);
957void term_bell(struct terminal *term);
958bool term_spawn_new(const struct terminal *term);
960void term_enable_app_sync_updates(struct terminal *term);
961void term_disable_app_sync_updates(struct terminal *term);
963enum term_surface term_surface_kind(
964 const struct terminal *term, const struct wl_surface *surface);
966bool term_scrollback_to_text(
967 const struct terminal *term, char **text, size_t *len);
968bool term_view_to_text(
969 const struct terminal *term, char **text, size_t *len);
970bool term_command_output_to_text(
971 const struct terminal *term, char **text, size_t *len);
973bool term_ime_is_enabled(const struct terminal *term);
974void term_ime_enable(struct terminal *term);
975void term_ime_disable(struct terminal *term);
976bool term_ime_reset(struct terminal *term);
977void term_ime_set_cursor_rect(
978 struct terminal *term, int x, int y, int width, int height);
980void term_urls_reset(struct terminal *term);
981void term_collect_urls(struct terminal *term);
983void term_osc8_open(struct terminal *term, uint64_t id, const char *uri);
984void term_osc8_close(struct terminal *term);
986bool term_ptmx_pause(struct terminal *term);
987bool term_ptmx_resume(struct terminal *term);
989void term_enable_size_notifications(struct terminal *term);
990void term_disable_size_notifications(struct terminal *term);
991void term_send_size_notification(struct terminal *term);
993void term_theme_switch_to_dark(struct terminal *term);
994void term_theme_switch_to_light(struct terminal *term);
995void term_theme_toggle(struct terminal *term);
996const struct color_theme *term_theme_get(const struct terminal *term);
998static inline void term_reset_grapheme_state(struct terminal *term)
999{
1000#if defined(FOOT_GRAPHEME_CLUSTERING)
1001 term->vt.grapheme_state = 0;
1002 term->vt.codepoint_merging_ok = false;
1003#endif
1004}
Diagnostics5 git calls · 31 ms
CallStatusSizeTime031 ms
discover200178 B2 ms
git.upload-pack discover http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=3 git.response.bytes=178 git.server.agent=git/2.56.1-Linux git.server.object_format=sha1 git.server.caps=agent ls-refs fetch server-option object-format git.server.fetch=shallow wait-for-done filter git.protocol.version=2 git.pkt.frames=9 git.pkt.data=7 git.pkt.flush=2 git.pkt.delim=0 git.pkt.bytes=178 git.pkt.payload.max=35
ls-refs20010 KiB2 ms
git.upload-pack ls-refs http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=2 git.response.bytes=10322 git.response.cache=UPDATING git.response.duration_ms=2 git.protocol.version=2 git.pkt.frames=108 git.pkt.data=107 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=10322 git.pkt.payload.max=106 git.ls_refs.count=107 git.ls_refs.head=refs/heads/master
fetchtree:0 · deepen 102009.3 KiB · hit3 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=3 git.response.bytes=9489 git.response.cache=HIT git.response.duration_ms=3 git.fetch.filter=tree:0 git.fetch.wants=c0d2c3e95d74cb60526ff28aec9f34ee3df545e0 git.fetch.haves.count=0 git.fetch.deepen=10 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=7 git.pkt.data=5 git.pkt.flush=1 git.pkt.delim=1 git.pkt.bytes=9489 git.pkt.payload.max=9389 git.sideband.band1.bytes=9389 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=10 git.pack.bytes=9389 git.pack.ofs_delta=0 git.pack.ref_delta=0 git.pack.chain.max=0 git.pack.trailer=de930681b6073ba5b599a0f956bfbd114762ad5a git.pack.full=10Open pack map
fetchcombine:blob:none+tree:2 · deepen 12008.6 KiB · hit3 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=24 git.response.bytes=8830 git.response.cache=HIT git.response.duration_ms=3 git.fetch.filter=combine:blob:none+tree:2 git.fetch.wants=c0d2c3e95d74cb60526ff28aec9f34ee3df545e0 git.fetch.haves.count=0 git.fetch.deepen=1 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=7 git.pkt.data=5 git.pkt.flush=1 git.pkt.delim=1 git.pkt.bytes=8830 git.pkt.payload.max=8730 git.sideband.band1.bytes=8730 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=14 git.pack.bytes=8730 git.fetch.wide.objects=14 git.fetch.wide.extra_bytes=9909 git.fetch.wide.blobs=0
fetch2007.6 KiB · hit26 ms
git.upload-pack fetch http.response.status_code=200 git.response.bytes=7808 git.response.cache=HIT git.response.duration_ms=26 git.fetch.wants=32145cac5c7bc7bfc48fea4e5358e899ae283e5b git.fetch.haves.count=0 git.fetch.deepen=0 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=4 git.pkt.data=3 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=7808 git.pkt.payload.max=7781 git.sideband.band1.bytes=7781 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0
Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.
- Remote
- https://codeberg.org/dnkl/foot
- Ref
- refs/heads/master
- Commit
- c0d2c3e95d74cb60526ff28aec9f34ee3df545e0
- cf-ray
- a5e2c1c9baba89da
- Request
- cac145aa…
- Protocol
- v2 · sha1
- Agent
- git/2.56.1-Linux
- Filter
- advertised
- Fetch
- shallow wait-for-done filter
- Capabilities
- agent ls-refs fetch server-option object-format