### Complete Key Binding Example Source: https://github.com/dnkl/foot/blob/master/_autodocs/06-key-binding-actions.md Provides a comprehensive example of key bindings for various operations including text, scrollback, search, font, terminal, URL handling, Unicode input, piping, and shell integration. Includes mouse bindings as well. ```ini [key-bindings] # Text operations copy=ctrl+shift+c paste=ctrl+shift+v select-all=ctrl+shift+a # Scrollback scrollback-up=shift+Page_Up scrollback-down=shift+Page_Down scrollback-home=shift+Home scrollback-bottom=shift+End # Search search-start=ctrl+shift+r # Font font-increase=ctrl+plus ctrl+equal font-decrease=ctrl+minus font-reset=ctrl+0 # Terminal spawn-terminal=ctrl+shift+n # URL show-urls-launch=ctrl+shift+o show-urls-copy=ctrl+shift+y # Unicode unicode-input=ctrl+shift+u # Piping pipe-selected=[xclip -i -selection clipboard] pipe-visible=[less] # Shell integration jump-label-prev=ctrl+shift+z jump-label-next=ctrl+shift+x [search-bindings] search-backward=ctrl+r search-forward=ctrl+s search-extend-word-wise=ctrl+w search-extend-word-wise-ws=ctrl+shift+w [mouse-bindings] select=Button1 select-word=Button1-2 select-quote=Button1-3 select-line=Button1-4 paste-primary=Button2 scrollback-up=Button4 scrollback-down=Button5 font-increase=ctrl+Button4 font-decrease=ctrl+Button5 ``` -------------------------------- ### Configure Select All Action Source: https://github.com/dnkl/foot/blob/master/_autodocs/06-key-binding-actions.md Example of how to bind the 'select-all' action to a key combination in the foot configuration file. ```ini [key-bindings] select-all=ctrl+shift+a ``` -------------------------------- ### Word Delimiters Example Source: https://github.com/dnkl/foot/blob/master/_autodocs/08-input-and-selection.md Shows how configured delimiters and spaces are used to define word boundaries for selection. This example uses a specific set of delimiters. ```text user@host:/path/to/file ^^^^ ^^^^ ^^ ^^ ^^^^ (selectable as words) ``` -------------------------------- ### Manual Server Start Commands Source: https://github.com/dnkl/foot/blob/master/_autodocs/09-server-mode.md Start the Foot server manually. The server runs in the foreground unless daemonized by systemd. You can specify a custom socket path or use the short form `-s`. ```bash foot --server foot --server /path/to/socket foot -s # Short form ``` -------------------------------- ### Configure Custom Terminfo Install Location Source: https://github.com/dnkl/foot/blob/master/INSTALL.md This command sets the installation path for Foot's terminfo definitions to '/usr/lib/foot/terminfo' and configures the build to set the TERMINFO environment variable accordingly. This allows Foot's terminfo files to coexist with ncurses' versions. ```sh meson --prefix=/usr -Dcustom-terminfo-install-location=lib/foot/terminfo ``` -------------------------------- ### Configure Copy Action Source: https://github.com/dnkl/foot/blob/master/_autodocs/06-key-binding-actions.md Example of how to bind the 'copy' action to a key combination in the foot configuration file. ```ini [key-bindings] copy=ctrl+shift+c ``` -------------------------------- ### footclient Program Usage Source: https://github.com/dnkl/foot/blob/master/_autodocs/09-server-mode.md Examples of how to launch the footclient program with various options to control new window behavior. ```bash footclient # New window in default dir footclient -w WIDTHxHEIGHT # Specified size footclient -D /path # Specific directory footclient -c CONFIG_PATH # Config file footclient -o override=value # Config override footclient -- command args # Run command instead of shell ``` -------------------------------- ### Connecting to an Existing PTY with Server Mode Source: https://github.com/dnkl/foot/blob/master/_autodocs/09-server-mode.md Shows how to start Foot in server mode and attach to a pre-existing pseudo-terminal (PTY). ```bash foot --server --pty=/dev/pts/5 ``` -------------------------------- ### Configure Scrollback Up Action Source: https://github.com/dnkl/foot/blob/master/_autodocs/06-key-binding-actions.md Example of how to bind the 'scrollback-up' action to a key combination in the foot configuration file. ```ini [key-bindings] scrollback-up=shift+Page_Up ``` -------------------------------- ### Log Server Output to File Source: https://github.com/dnkl/foot/blob/master/_autodocs/09-server-mode.md Starts the foot server and redirects all logs to a specified file, running in the background. ```bash foot --server -l always > /tmp/foot.log 2>&1 & ``` -------------------------------- ### Configure Scrollback Home Action Source: https://github.com/dnkl/foot/blob/master/_autodocs/06-key-binding-actions.md Example of how to bind the 'scrollback-home' action to a key combination in the foot configuration file. ```ini [key-bindings] scrollback-home=shift+Home ``` -------------------------------- ### Start Scrollback Search Source: https://github.com/dnkl/foot/blob/master/_autodocs/06-key-binding-actions.md Begins a scrollback search. Configure this action in the [key-bindings] section. ```ini [key-bindings] search-start=ctrl+shift+r ``` -------------------------------- ### Configure Paste Action Source: https://github.com/dnkl/foot/blob/master/_autodocs/06-key-binding-actions.md Example of how to bind the 'paste' action to a key combination in the foot configuration file. ```ini [key-bindings] paste=ctrl+shift+v ``` -------------------------------- ### Mark Start of Command Output (OSC 133) Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md Marks the beginning of command output. The sequence starts with OSC 133; B and ends with ST. ```text OSC 133 ; B ST ``` -------------------------------- ### Color Format Example Source: https://github.com/dnkl/foot/blob/master/_autodocs/03-configuration-api.md Illustrates the format for specifying colors in configuration. Supports named colors, hex codes, and palette indices. ```ini foreground=#d8d8d8 ``` -------------------------------- ### Mark Start of Prompt (OSC 133) Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md Marks the beginning of a command prompt. The sequence starts with OSC 133; A and ends with ST. ```text OSC 133 ; A ST ``` -------------------------------- ### Configure Scrollback Bottom Action Source: https://github.com/dnkl/foot/blob/master/_autodocs/06-key-binding-actions.md Example of how to bind the 'scrollback-bottom' action to a key combination in the foot configuration file. ```ini [key-bindings] scrollback-bottom=shift+End ``` -------------------------------- ### Configure Scrollback Down Action Source: https://github.com/dnkl/foot/blob/master/_autodocs/06-key-binding-actions.md Example of how to bind the 'scrollback-down' action to a key combination in the foot configuration file. ```ini [key-bindings] scrollback-down=shift+Page_Down ``` -------------------------------- ### Key Binding Example Source: https://github.com/dnkl/foot/blob/master/_autodocs/03-configuration-api.md Defines custom key bindings for actions. Use this to map keyboard shortcuts to specific operations. ```ini [key-bindings] copy=ctrl+shift+c paste=ctrl+shift+v scrollback-up=shift+Page_Up ``` -------------------------------- ### Configure Primary Paste Action Source: https://github.com/dnkl/foot/blob/master/_autodocs/06-key-binding-actions.md Example of how to bind the 'primary-paste' action to a key combination in the foot configuration file. ```ini [key-bindings] primary-paste=shift+Insert ``` -------------------------------- ### Run the Built Foot Application Source: https://github.com/dnkl/foot/blob/master/INSTALL.md Executes the Foot application directly from the build directory. Use the `--term` flag if terminfo definitions were not installed. ```sh ./foot ``` ```sh ./foot --term xterm-256color ``` -------------------------------- ### Line-wise Selection Example Source: https://github.com/dnkl/foot/blob/master/_autodocs/08-input-and-selection.md Illustrates full line selection. This mode selects entire lines of text. ```text Hello World ----------- ``` -------------------------------- ### Word-wise Selection Example Source: https://github.com/dnkl/foot/blob/master/_autodocs/08-input-and-selection.md Demonstrates word-based selection. Words are separated by configured delimiters and spaces. ```text Hello World ^^^^^ ^^^^^ ``` -------------------------------- ### Configure Deselect Action Source: https://github.com/dnkl/foot/blob/master/_autodocs/06-key-binding-actions.md Example of how to bind the 'deselect' action to a key combination in the foot configuration file. ```ini [key-bindings] deselect=escape ``` -------------------------------- ### Inspect Foot Process Information Source: https://github.com/dnkl/foot/blob/master/_autodocs/09-server-mode.md Use 'ps aux' combined with 'grep' to get detailed information about running 'foot' processes. ```bash ps aux | grep foot # Full process info ``` -------------------------------- ### Systemd Service Unit File Source: https://github.com/dnkl/foot/blob/master/_autodocs/09-server-mode.md Configuration for the systemd service unit that specifies how to start the `foot --server` process. ```ini [Service] Type=simple ExecStart=foot --server ``` -------------------------------- ### Start Foot in Server Mode Source: https://github.com/dnkl/foot/blob/master/README.md Run foot in server mode to host multiple terminal windows from a single process. This reduces memory usage and speeds up startup by sharing fonts and glyph caches. ```bash foot --server ``` -------------------------------- ### Log Server Output to Stderr Source: https://github.com/dnkl/foot/blob/master/_autodocs/09-server-mode.md Use this command to start the foot server and log debug information to standard error. ```bash foot --server -d info # Log to stderr ``` -------------------------------- ### Character-wise Selection Example Source: https://github.com/dnkl/foot/blob/master/_autodocs/08-input-and-selection.md Illustrates character-by-character selection. This mode selects individual characters. ```text Hello World ^^^^^ ``` -------------------------------- ### Block Selection Example Source: https://github.com/dnkl/foot/blob/master/_autodocs/08-input-and-selection.md Demonstrates rectangular block selection. This mode selects a region based on column boundaries. ```text Hello World ^^^ ^^^ ``` -------------------------------- ### Initialize Terminal Instance Source: https://github.com/dnkl/foot/blob/master/_autodocs/02-terminal-api.md Initializes a new terminal instance by creating a PTY, spawning a shell process, and setting up rendering and event handlers. Use this when starting a new terminal window. ```c struct terminal *term_init( const struct config *conf, struct fdm *fdm, struct reaper *reaper, struct wayland *wayl, const char *foot_exe, const char *cwd, const char *token, const char *pty_path, int argc, char *const *argv, const char *const *envp, void (*shutdown_cb)(void *data, int exit_code), void *shutdown_data); ``` -------------------------------- ### Set Window Title (OSC 2) Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md Sets the window title. The sequence starts with OSC 2 and ends with ST. ```text OSC 2 ; text ST ``` -------------------------------- ### Key Binding Configuration Source: https://github.com/dnkl/foot/blob/master/_autodocs/03-configuration-api.md Example INI format for defining custom key bindings in Foot. This covers common actions like copy, paste, scrolling, font manipulation, and spawning new terminals. ```ini [key-bindings] copy=ctrl+shift+c paste=ctrl+shift+v scrollback-up=shift+Page_Up scrollback-down=shift+Page_Down scrollback-top=shift+Home scrollback-bottom=shift+End search-start=ctrl+shift+r font-increase=ctrl+plus ctrl+equal font-decrease=ctrl+minus font-reset=ctrl+0 spawn-terminal=ctrl+shift+n show-urls-launch=ctrl+shift+o ``` -------------------------------- ### Color Theme Configuration Source: https://github.com/dnkl/foot/blob/master/_autodocs/03-configuration-api.md Example INI format for defining color schemes in Foot. This includes foreground, background, alpha, basic 16 colors, cursor, and selection colors. ```ini [colors] foreground=#d8d8d8 background=#181818 alpha=0.9 # Basic 16 colors colors=\ #000000 #e74c3c #2ecc71 #f39c12 #3498db #9b59b6 #1abc9c #ecf0f1 \ #34495e #e67e22 #27ae60 #f1c40f #2980b9 #8e44ad #16a085 #bdc3c7 # Cursor and selection cursor-foreground=#000000 cursor-background=#cccccc selection-foreground=#181818 selection-background=#d8d8d8 ``` -------------------------------- ### Block Selection Visual Example Source: https://github.com/dnkl/foot/blob/master/_autodocs/08-input-and-selection.md Visual representation of block selection, highlighting how it spans columns across multiple lines. ```text Line 1: A B C D E F ↓ ↓ ↓ Line 2: a b c d e f ← Selection spans columns 1-3 ↓ ↓ ↓ Line 3: 1 2 3 4 5 6 ``` -------------------------------- ### Create Simple Hyperlink (OSC 8) Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md Creates a simple hyperlink to a web URI. The sequence starts with OSC 8, followed by the URI, then the link text, and ends with OSC 8 and ST. ```text OSC 8 ; ; http://example.com ST Click here OSC 8 ; ; ST ``` -------------------------------- ### Systemd Socket Activation Source: https://github.com/dnkl/foot/blob/master/_autodocs/09-server-mode.md Foot supports systemd socket activation. Starting the socket unit will launch the `foot --server` process on demand when `footclient` connects. ```bash systemctl start foot-server.socket footclient # Triggers foot --server if not running ``` -------------------------------- ### Font Configuration Source: https://github.com/dnkl/foot/blob/master/_autodocs/03-configuration-api.md Example INI format for configuring fonts in Foot. This includes setting the primary font with fallbacks, individual fallback fonts, font size, DPI awareness, line height, and letter spacing. ```ini [font] # Primary font with fallbacks font=monospace:size=12 # or individual fallbacks: # font=JetBrains Mono:size=12 # font=Noto Mono:size=12 # Alternative sizes for different weights size=12 dpi-aware=yes line-height=1.1 letter-spacing=0 ``` -------------------------------- ### Configure Terminfo with Custom Naming Source: https://github.com/dnkl/foot/blob/master/INSTALL.md This command configures the build to use 'foot' as the default terminfo and 'foot-extra' as the base name for terminfo files. This is useful if you want to install terminfo files under a different name than the default. ```sh meson ... -Ddefault-terminfo=foot -Dterminfo-base-name=foot-extra ``` -------------------------------- ### Create Hyperlink (OSC 8) Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md Creates a hyperlink with optional parameters and associated text. The sequence starts with OSC 8, includes parameters and a URI, followed by the text, and ends with OSC 8 and ST. ```text OSC 8 ; params ; URI ST text OSC 8 ; ; ST ``` -------------------------------- ### Create Build Directory and Enter Release Mode Source: https://github.com/dnkl/foot/blob/master/INSTALL.md Use this command to set up the build environment by creating a release build directory and navigating into it. ```sh mkdir -p bld/release && cd bld/release ``` -------------------------------- ### Create Hyperlink with ID (OSC 8) Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md Creates a hyperlink with a unique ID and a file URI. The sequence starts with OSC 8, includes the 'id' parameter and file URI, followed by the link text, and ends with OSC 8 and ST. ```text OSC 8 ; id=1 ; file:///path/to/file ST File OSC 8 ; ; ST ``` -------------------------------- ### Compile Terminfo Files Manually Source: https://github.com/dnkl/foot/blob/master/INSTALL.md Compiles terminfo files using `tic`. The output directory must match the custom install location if specified during the build. ```sh sed 's/@default_terminfo@/foot/g' foot.info | \ tic -o -x -e foot,foot-direct - ``` ```sh tic -o ${DESTDIR}/usr/share/terminfo ... ``` -------------------------------- ### Running Multiple Foot Servers Source: https://github.com/dnkl/foot/blob/master/_autodocs/09-server-mode.md Demonstrates how to launch and connect to multiple independent Foot servers on the same display using distinct socket files. ```bash foot --server=/tmp/server1.sock & foot --server=/tmp/server2.sock & footclient --server=/tmp/server1.sock footclient --server=/tmp/server2.sock ``` -------------------------------- ### Display Client Help Options Source: https://github.com/dnkl/foot/blob/master/_autodocs/09-server-mode.md Use the --help flag with footclient to view all available command-line options. ```bash footclient --help # See all options ``` -------------------------------- ### Set Window Icon and Title (OSC 0) Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md Sets the window icon name and title. Only the title is typically used by modern terminals. The sequence starts with OSC 0 and ends with ST. ```text OSC 0 ; text ST ``` -------------------------------- ### Mark End of Command (Start of Output) (OSC 133) Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md Marks the end of a command and the beginning of its output. The sequence starts with OSC 133; C and ends with ST. ```text OSC 133 ; C ST ``` -------------------------------- ### Persistent Server Mode Source: https://github.com/dnkl/foot/blob/master/_autodocs/09-server-mode.md Start the foot server in the background and launch new terminal clients using 'footclient'. This keeps the server running even after all client windows are closed. ```bash foot --server & # Background server footclient # New window 1 footclient # New window 2 # Close windows, server still running ``` -------------------------------- ### Foot Server Service Configuration Source: https://github.com/dnkl/foot/blob/master/_autodocs/09-server-mode.md Configuration for the systemd service unit that runs the Foot terminal server. It defines how the server is started, its dependencies on the socket unit, and restart behavior. ```ini [Unit] Description=Foot terminal server Documentation=man:foot(1) Requires=foot-server.socket After=foot-server.socket PartOf=foot-server.socket [Service] Type=simple ExecStart=/usr/bin/foot --server Restart=on-failure RestartSec=5s ``` -------------------------------- ### Bind show-urls-launch action Source: https://github.com/dnkl/foot/blob/master/_autodocs/06-key-binding-actions.md Binds the 'show-urls-launch' action to 'ctrl+shift+o'. Use this to enter URL mode and open URLs. ```ini [key-bindings] show-urls-launch=ctrl+shift+o ``` -------------------------------- ### Query Terminal Capabilities (XTGETTCAP) Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md Queries terminal capabilities using keywords. The request starts with DCS + q and ends with ST. The response format is DCS 1 + r with keyword=value pairs, also ending with ST. ```text DCS + q keyword ; keyword ; ... ST ``` ```text DCS 1 + r keyword = value ; keyword = value ST ``` -------------------------------- ### term_font_dpi_changed Source: https://github.com/dnkl/foot/blob/master/_autodocs/02-terminal-api.md Called when the monitor DPI changes, for example, when a window is moved to a different display. ```APIDOC ## term_font_dpi_changed ### Description Called when monitor DPI changes (e.g., window moved to different display). ### Signature ```c bool term_font_dpi_changed(struct terminal *term, float old_scale); ``` ``` -------------------------------- ### Configure and Build Foot with PGO Source: https://github.com/dnkl/foot/blob/master/INSTALL.md Instructs Meson to use the generated PGO data and rebuilds the project. Includes running tests after the build. ```sh meson configure -Db_pgo=use ninja ninja test ``` -------------------------------- ### term_xcursor_update_for_seat Source: https://github.com/dnkl/foot/blob/master/_autodocs/02-terminal-api.md Updates the X cursor for a specific seat, useful in multi-seat Wayland setups. ```APIDOC ## term_xcursor_update_for_seat ### Description Updates the X cursor for a specific seat (in multi-seat Wayland setup). ### Signature ```c void term_xcursor_update_for_seat(struct terminal *term, struct seat *seat); ``` ``` -------------------------------- ### Get Terminal Icon Name Source: https://github.com/dnkl/foot/blob/master/_autodocs/02-terminal-api.md Retrieves the icon name string for the terminal, typically 'terminal'. ```c const char *term_icon(const struct terminal *term); ``` -------------------------------- ### Copy Text to Clipboard (OSC 52) Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md Copies data to a specified clipboard buffer. 'c' denotes the system clipboard. Data must be base64-encoded. The sequence starts with OSC 52, specifies the buffer, the base64 data, and ends with ST. ```text OSC 52 ; c ; SGVsbG8gV29ybGQ= ST ``` -------------------------------- ### Enable Client Logging Source: https://github.com/dnkl/foot/blob/master/_autodocs/09-server-mode.md Run the foot client with the '-d info' option to enable detailed logging for client-side operations. ```bash footclient -d info # Client logging ``` -------------------------------- ### Build Foot with Performance Optimization (Non-PGO) Source: https://github.com/dnkl/foot/blob/master/INSTALL.md Perform a standard release build optimized for performance using -O3. Use -O2 for a slightly smaller and slower binary. ```sh export CFLAGS="$CFLAGS -O3" meson --buildtype=release --prefix=/usr -Db_lto=true ../.. ninja ninja test ninja install ``` -------------------------------- ### Get Current Terminal Theme Source: https://github.com/dnkl/foot/blob/master/_autodocs/02-terminal-api.md Retrieves a pointer to the currently active color theme configuration for the terminal. ```c const struct color_theme *term_theme_get(const struct terminal *term); ``` -------------------------------- ### Bind show-urls-copy action Source: https://github.com/dnkl/foot/blob/master/_autodocs/06-key-binding-actions.md Binds the 'show-urls-copy' action to 'ctrl+shift+c'. Use this to enter URL mode and copy URLs to the clipboard. ```ini [key-bindings] show-urls-copy=ctrl+shift+c ``` -------------------------------- ### URL Launch Configuration Source: https://github.com/dnkl/foot/blob/master/_autodocs/08-input-and-selection.md This C structure points to the configuration template used for launching URLs. The configured command is executed with the URL as a parameter. ```c const struct config_spawn_template *url_launch; ``` -------------------------------- ### Connect to Wayland Display Source: https://github.com/dnkl/foot/blob/master/_autodocs/10-wayland-integration.md Establishes a connection to the Wayland display server. This is the initial step for any Wayland client application. ```c struct wayland *wayl = wayland_connect(); ``` -------------------------------- ### Partial PGO Build Data Generation Source: https://github.com/dnkl/foot/blob/master/INSTALL.md Generate profiling data using a PGO helper binary that links only against the VT parser. This method does not require a Wayland session but exercises fewer code paths, potentially resulting in a slightly slower binary compared to a full PGO build. Ensure to run foot and footclient --version first to gather some initial profiling data. ```sh ./utils/xtgettcap ./footclient --version ./foot --version tmp_file=$(mktemp) ../../scripts/generate-alt-random-writes \ --rows=67 \ --cols=135 \ --scroll \ --scroll-region \ --colors-regular \ --colors-bright \ --colors-256 \ --colors-rgb \ --attr-bold \ --attr-italic \ --attr-underline \ --sixel \ ${tmp_file} ./pgo ${tmp_file} ${tmp_file} ${tmp_file} rm ${tmp_file} ``` -------------------------------- ### Quote-wise Selection Example Source: https://github.com/dnkl/foot/blob/master/_autodocs/08-input-and-selection.md Shows selection between quotes or to the end of the line. Useful for selecting quoted strings or content within quotes. ```text "Hello World" extra ^^^^^^^^^^^^^^ ``` -------------------------------- ### Configure URL Launching in Foot Source: https://github.com/dnkl/foot/blob/master/README.md Customize how URLs are handled when activated in Foot. The `url-launch` option overrides the default `xdg-open` behavior. ```ini [url] launch=xdg-open ``` -------------------------------- ### Simple Desktop Notification (OSC 9) Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md Sends a simple desktop notification. This method is deprecated. The sequence starts with OSC 9 and ends with ST. ```text OSC 9 ; text ST ``` -------------------------------- ### Reset Cursor Color to Default (OSC 112) Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md Resets the cursor color to its default value. The sequence starts with OSC 112 and ends with ST. ```text OSC 112 ST ``` -------------------------------- ### XKB State Management Structures Source: https://github.com/dnkl/foot/blob/master/_autodocs/08-input-and-selection.md Structures for managing XKB context, keyboard layout, and state, including compose table and state for handling complex character sequences. ```c struct xkb_context *xkb; struct xkb_keymap *xkb_keymap; struct xkb_state *xkb_state; struct xkb_compose_table *xkb_compose_table; struct xkb_compose_state *xkb_compose_state; ``` -------------------------------- ### Configure Foot for PGO Data Generation Source: https://github.com/dnkl/foot/blob/master/INSTALL.md Configure the build system to generate profiling data for PGO. It is crucial to use -O3 for this step, as -O2 may result in significantly slower binaries with GCC 10.1.x and later. Clang users must add -Wno-ignored-optimization-argument to CFLAGS. ```sh export CFLAGS="$CFLAGS -O3" meson --buildtype=release --prefix=/usr -Db_lto=true ../.. ``` -------------------------------- ### Get Font Baseline Offset Source: https://github.com/dnkl/foot/blob/master/_autodocs/02-terminal-api.md Retrieves the vertical offset from the top of a cell to the font's baseline. This is useful for precise text layout calculations. ```c int term_font_baseline(const struct terminal *term); ``` -------------------------------- ### Reset Background Color to Default (OSC 111) Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md Resets the default background color to its default value. The sequence starts with OSC 111 and ends with ST. ```text OSC 111 ST ``` -------------------------------- ### Run vtebench Benchmark Source: https://github.com/dnkl/foot/blob/master/doc/benchmark.md Execute the vtebench tool to run benchmarks. Specify the benchmark directory and a data directory for results. ```sh ./target/release/vtebench -b ./benchmarks --dat /tmp/ ``` -------------------------------- ### Reset Foreground Color to Default (OSC 110) Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md Resets the default foreground color to its default value. The sequence starts with OSC 110 and ends with ST. ```text OSC 110 ST ``` -------------------------------- ### Reset Color Palette to Defaults (OSC 104) Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md Resets the entire color palette to its default values. The sequence starts with OSC 104 and ends with ST. ```text OSC 104 ST ``` -------------------------------- ### dnkl_foot Data Flow Diagram Source: https://github.com/dnkl/foot/blob/master/_autodocs/README.md Illustrates the data flow within the dnkl_foot terminal emulator, from input to display. ```text Wayland/PTY Input → FDM Event Loop → Input Handler/VT Parser ↓ Grid Updates → Damage Tracking → Rendering Workers ↓ Wayland Buffers → Display ``` -------------------------------- ### Set Wayland Application ID (OSC 176) Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md Sets the Wayland application ID for the terminal window. The sequence starts with OSC 176 and ends with ST. ```text OSC 176 ; appid ST ``` -------------------------------- ### Build Foot with Size Optimization Source: https://github.com/dnkl/foot/blob/master/INSTALL.md Optimize the Foot binary for size by setting CFLAGS to -Os. This configuration is suitable when a smaller executable is preferred. ```sh export CFLAGS="$CFLAGS -Os" meson --buildtype=release --prefix=/usr -Db_lto=true ../.. ninja ninja test ninja install ``` -------------------------------- ### term_fill Source: https://github.com/dnkl/foot/blob/master/_autodocs/02-terminal-api.md Fills a specified number of cells with a given character, starting from a given row and column. This function is useful for operations like erasing content or drawing boxes. ```APIDOC ## term_fill ### Description Fills multiple cells with a character. Used for erase operations and box drawing. ### Method void ### Parameters - **term** (struct terminal *): Pointer to the terminal instance. - **row** (int): The starting row. - **col** (int): The starting column. - **c** (uint8_t): The character to fill with. - **count** (size_t): The number of cells to fill. - **use_sgr_attrs** (bool): Whether to use SGR attributes. ### Returns None ``` -------------------------------- ### Reset Selection Foreground Color to Default (OSC 119) Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md Resets the selection foreground color to its default value. The sequence starts with OSC 119 and ends with ST. ```text OSC 119 ST ``` -------------------------------- ### term_init() Source: https://github.com/dnkl/foot/blob/master/_autodocs/02-terminal-api.md Initializes a new terminal instance. This function creates a PTY, spawns a shell process, sets up the rendering state, and configures event handlers. It is intended to be called once per terminal window. ```APIDOC ## term_init() ### Description Initializes a new terminal instance. Creates a PTY, spawns shell process, initializes rendering state, and wires up event handlers. This is called once per terminal window. ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - None ### Parameters - **conf** (struct config *) - Configuration object loaded from foot.ini - **fdm** (struct fdm *) - File descriptor monitor for event handling - **reaper** (struct reaper *) - Child process reaper for tracking zombies - **wayl** (struct wayland *) - Wayland display connection - **foot_exe** (const char *) - Path to foot executable (for spawning new instances) - **cwd** (const char *) - Initial working directory (from OSC 7 or env) - **token** (const char *) - Unique token for socket activation - **pty_path** (const char *) - Path to existing PTY (if not creating new one) - **argc** (int) - Command line argument count - **argv** (char * const *) - Command line arguments (shell to execute) - **envp** (const char * const *) - Environment variables to pass to shell - **shutdown_cb** (function pointer) - Callback when terminal shuts down - **shutdown_data** (void *) - User data passed to shutdown callback ### Returns - **struct terminal *** - Initialized `struct terminal` pointer, or NULL on failure ``` -------------------------------- ### Reset Selection Background Color to Default (OSC 117) Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md Resets the selection background color to its default value. The sequence starts with OSC 117 and ends with ST. ```text OSC 117 ST ``` -------------------------------- ### Visual Bell Flash (OSC 555) Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md Flashes the screen for a specified duration to indicate a visual bell. This is a foot-specific sequence. The sequence starts with OSC 555 and ends with ST. ```text OSC 555 ; duration ST ``` -------------------------------- ### Freedesktop Desktop Notification (OSC 777) Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md Sends a desktop notification using the freedesktop specification, including a title and body. The sequence starts with OSC 777 and ends with ST. ```text OSC 777 ; notify ; title ; body ST ``` -------------------------------- ### Reset Specific Color Palette Entry (OSC 104) Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md Resets a specific color palette entry to its default value. The sequence starts with OSC 104 and ends with ST. ```text OSC 104 ; index ST ``` -------------------------------- ### Switch to Light Theme Server-Wide Source: https://github.com/dnkl/foot/blob/master/_autodocs/09-server-mode.md Call this C function to switch the server's color theme to light. This action refreshes all open terminals simultaneously. ```c void server_global_theme_switch_to_light(struct server *server); ``` -------------------------------- ### Basic Key Bindings with Modifiers Source: https://github.com/dnkl/foot/blob/master/_autodocs/06-key-binding-actions.md Demonstrates the use of modifier keys (Ctrl, Shift, Alt, Super) in basic key bindings for actions like copy, select-all, and paste. ```ini [key-bindings] copy=ctrl+shift+c select-all=shift+alt+a paste=super+v ``` -------------------------------- ### Automated PGO Build for Foot Source: https://github.com/dnkl/foot/blob/master/INSTALL.md Use the pgo.sh script for a complete PGO build. Ensure LC_CTYPE is set to a UTF-8 locale for full PGO builds. This script automates the PGO build process. ```sh cd foot ./pgo/pgo.sh auto . /tmp/foot-pgo-build-output ``` -------------------------------- ### Update X Cursor for Specific Seat Source: https://github.com/dnkl/foot/blob/master/_autodocs/02-terminal-api.md Updates the X cursor for a specific seat, which is relevant in multi-seat Wayland setups. Use this when dealing with multiple input devices or displays. ```c void term_xcursor_update_for_seat(struct terminal *term, struct seat *seat); ``` -------------------------------- ### Jump to Previous/Next Prompt Marker Key Bindings Source: https://github.com/dnkl/foot/blob/master/_autodocs/06-key-binding-actions.md Defines key bindings for navigating to the previous or next prompt marker. Requires OSC 133 shell integration. ```ini [key-bindings] jump-label-prev=ctrl+shift+z jump-label-next=ctrl+shift+x ``` -------------------------------- ### Mark End of Output with Exit Code (OSC 133) Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md Marks the end of command output and includes the exit code. The sequence starts with OSC 133; D with the exit code and ends with ST. ```text OSC 133 ; D ; exit-code ST ``` -------------------------------- ### Check Fractional Scaling Support Source: https://github.com/dnkl/foot/blob/master/_autodocs/02-terminal-api.md Checks if the compositor supports the fractional scaling protocol. Use this to determine if fractional scaling is available. ```c bool term_fractional_scaling(const struct terminal *term); ``` -------------------------------- ### Report Current Working Directory (OSC 7) Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md Reports the current working directory to the terminal, allowing new windows to open in the same directory. The sequence starts with OSC 7 and ends with ST. ```text OSC 7 ; file://hostname/path ST ``` -------------------------------- ### Configure Foot to Pipe Last Command Output to Emacs Source: https://github.com/dnkl/foot/blob/master/README.md Set up the `pipe-command-output` key binding in Foot to pipe the last command's output to emacsclient. This requires shell support for OSC-133;C and OSC-133;D sequences. ```ini [key-bindings] pipe-command-output=[sh -c "f=$(mktemp); cat - > $f; footclient emacsclient -nw $f; rm $f"] Control+Shift+g ``` -------------------------------- ### Set Cursor Color (OSC 12) Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md Sets the cursor color using an RGB value. The format for RGB can be 'rgb:RRRR/GGGG/BBBB' or '#RRGGBB'. The sequence starts with OSC 12 and ends with ST. ```text OSC 12 ; rgb ST ``` -------------------------------- ### Spawn New Terminal Window Source: https://github.com/dnkl/foot/blob/master/_autodocs/06-key-binding-actions.md Opens a new terminal window, potentially in the same working directory if OSC 7 is used. Configure this action in the [key-bindings] section. ```ini [key-bindings] spawn-terminal=ctrl+shift+n ``` -------------------------------- ### URL and Overlay Actions/Styles Source: https://github.com/dnkl/foot/blob/master/_autodocs/02-terminal-api.md Defines actions that can be taken on detected URLs (copy, launch, persist) and the styles for various terminal overlays like search or flash. ```c enum url_action { URL_ACTION_COPY, /* Copy URL to clipboard */ URL_ACTION_LAUNCH, /* Open URL with configured application */ URL_ACTION_PERSISTENT, /* Keep URL highlighted */ }; enum overlay_style { OVERLAY_NONE, /* No overlay */ OVERLAY_SEARCH, /* Search box overlay */ OVERLAY_FLASH, /* Screen flash overlay */ OVERLAY_UNICODE_MODE, /* Unicode input mode overlay */ }; enum term_surface { TERM_SURF_NONE, TERM_SURF_GRID, /* Main text grid */ TERM_SURF_TITLE, TERM_SURF_BORDER_LEFT, TERM_SURF_BORDER_RIGHT, TERM_SURF_BORDER_TOP, TERM_SURF_BORDER_BOTTOM, TERM_SURF_BUTTON_MINIMIZE, TERM_SURF_BUTTON_MAXIMIZE, TERM_SURF_BUTTON_CLOSE, }; ``` -------------------------------- ### Set Mouse Pointer Shape (OSC 22) Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md Sets the mouse pointer shape for the terminal window. Common values include 'hand2', 'text', 'left_ptr'. The sequence starts with OSC 22 and ends with ST. ```text OSC 22 ; cursor-name ST ``` -------------------------------- ### Show Cursor Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md Use CSI ? 12 h or CSI ? 25 h to make the cursor visible in the terminal. ```bash CSI ? 12 h ``` ```bash CSI ? 25 h ``` -------------------------------- ### Set Selection Foreground Color (OSC 19) Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md Sets the selection foreground color using an RGB value. The format for RGB can be 'rgb:RRRR/GGGG/BBBB' or '#RRGGBB'. The sequence starts with OSC 19 and ends with ST. ```text OSC 19 ; rgb ST ``` -------------------------------- ### ANSI vs VT52 Mode Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md Use CSI ? 2 h to enable ANSI mode and CSI ? 2 l to enable VT52 mode. ```bash CSI ? 2 h ``` ```bash CSI ? 2 l ``` -------------------------------- ### Set Selection Background Color (OSC 17) Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md Sets the selection background color using an RGB value. The format for RGB can be 'rgb:RRRR/GGGG/BBBB' or '#RRGGBB'. The sequence starts with OSC 17 and ends with ST. ```text OSC 17 ; rgb ST ``` -------------------------------- ### Generate PGO Profiling Data Source: https://github.com/dnkl/foot/blob/master/INSTALL.md Instruct Meson to generate profiling data and build the instrumented version of Foot. This step is necessary before generating the actual profiling data. ```sh meson configure -Db_pgo=generate ninja ninja test ``` -------------------------------- ### Set Default Background Color (OSC 11) Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md Sets the default background color using an RGB value. The format for RGB can be 'rgb:RRRR/GGGG/BBBB' or '#RRGGBB'. The sequence starts with OSC 11 and ends with ST. ```text OSC 11 ; rgb ST ``` -------------------------------- ### Set Default Foreground Color (OSC 10) Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md Sets the default foreground color using an RGB value. The format for RGB can be 'rgb:RRRR/GGGG/BBBB' or '#RRGGBB'. The sequence starts with OSC 10 and ends with ST. ```text OSC 10 ; rgb ST ``` -------------------------------- ### Set Color Palette Entry (OSC 4) Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md Sets a specific color palette entry to an RGB value. The format for RGB can be 'rgb:RRRR/GGGG/BBBB' or '#RRGGBB'. The sequence starts with OSC 4 and ends with ST. ```text OSC 4 ; index ; rgb ST ``` -------------------------------- ### XTVERSION Query Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md Sends a DCS > $ t ST sequence to query the terminal version. The response indicates the terminal name and version. ```text DCS > $ t ST ``` ```text DCS > | foot(version) ST ``` -------------------------------- ### Server Mode Memory Savings Comparison Source: https://github.com/dnkl/foot/blob/master/_autodocs/09-server-mode.md Compares memory usage between normal and server modes for three windows, highlighting the significant savings achieved with server mode. ```text Normal mode (3 windows): Window 1: 20 MB (fonts, glyph cache) Window 2: 20 MB (fonts, glyph cache) Window 3: 20 MB (fonts, glyph cache) Total: 60 MB Server mode (3 windows): Server: 20 MB (shared fonts, glyph cache) Client 1: 5 MB Client 2: 5 MB Client 3: 5 MB Total: 35 MB (42% savings) ``` -------------------------------- ### Configure URL Copying in Foot Source: https://github.com/dnkl/foot/blob/master/README.md Enable the `show-urls-copy` action to copy URLs to the clipboard instead of opening them. This binding is unbound by default. ```ini [key-bindings] show-urls-copy=none ``` -------------------------------- ### Enable Kitty Keyboard Protocol Source: https://github.com/dnkl/foot/blob/master/_autodocs/04-escape-sequences.md These sequences enable different features of the Kitty keyboard protocol. Use CSI ? 0 u to disable the protocol. ```bash CSI ? 1 ; 1 u ``` ```bash CSI ? 1 ; 2 u ``` ```bash CSI ? 1 ; 4 u ``` -------------------------------- ### Mouse Button Selection Bindings Source: https://github.com/dnkl/foot/blob/master/_autodocs/06-key-binding-actions.md Configures mouse button actions for text selection, including single-click for start selection, double-click for word selection, triple-click for quoted text or line selection, and quad-click for entire line selection. ```ini [mouse-bindings] select=Button1 select-word=Button1-2 select-quote=Button1-3 select-line=Button1-4 ``` -------------------------------- ### Validate Configuration Source: https://github.com/dnkl/foot/blob/master/_autodocs/03-configuration-api.md Use the -C flag to validate the configuration file. The command exits with 0 if the configuration is valid and 1 if there are errors. ```bash foot -C ```