Actions Reference
Complete reference of all actions available in Television.
What are Actions?
Actions are the operations tv can perform in response to key presses or other events. They're used in:
- Keybinding configuration
- Custom channel actions
- Multi-action key bindings
Action Syntax
In configuration files, actions use snake_case:
[keybindings]
ctrl-j = "select_next_entry"
ctrl-k = "select_prev_entry"
Navigation Actions
| Action | Description | Default Key |
|---|---|---|
select_next_entry | Move selection down | ↓, Ctrl+n, Ctrl+j |
select_prev_entry | Move selection up | ↑, Ctrl+p, Ctrl+k |
select_next_page | Move down one page | - |
select_prev_page | Move up one page | - |
Selection Actions
| Action | Description | Default Key |
|---|---|---|
confirm_selection | Confirm current selection (multi-selection or entry under cursor) and exit | Enter |
select_and_exit | Select the entry under the cursor and exit | - |
toggle_selection | Toggle selection | Tab |
toggle_selection_all | Select all entries, or clear the selection if all are selected | Shift+Tab (config key name: backtab) |
copy_entry_to_clipboard | Copy entry to clipboard | Ctrl+y |
Input Editing Actions
| Action | Description | Default Key |
|---|---|---|
delete_prev_char | Delete character before cursor | Backspace |
delete_next_char | Delete character after cursor | Delete |
delete_prev_word | Delete previous word | Ctrl+w |
delete_line | Clear entire input | Ctrl+u |
go_to_prev_char | Move cursor left | ← |
go_to_next_char | Move cursor right | → |
go_to_input_start | Move cursor to start | Home, Ctrl+a |
go_to_input_end | Move cursor to end | End, Ctrl+e |
Preview Actions
| Action | Description | Default Key |
|---|---|---|
scroll_preview_up | Scroll preview up one line | - |
scroll_preview_down | Scroll preview down one line | - |
scroll_preview_half_page_up | Scroll preview up half page | PageUp |
scroll_preview_half_page_down | Scroll preview down half page | PageDown |
cycle_previews | Cycle through preview commands | Ctrl+F |
UI Toggle Actions
| Action | Description | Default Key |
|---|---|---|
toggle_preview | Show/hide preview panel | Ctrl+o |
toggle_remote_control | Show/hide channel picker | Ctrl+t |
toggle_help | Show/hide help panel | Ctrl+h |
toggle_status_bar | Show/hide status bar | F12 |
toggle_layout | Switch portrait/landscape | Ctrl+l |
toggle_action_picker | Show available actions | Ctrl+x |
Channel Actions
| Action | Description | Default Key |
|---|---|---|
cycle_sources | Cycle through source commands | Ctrl+s |
reload_source | Reload current source | Ctrl+r |
History Actions
| Action | Description | Default Key |
|---|---|---|
select_prev_history | Previous history entry | Ctrl+↑ |
select_next_history | Next history entry | Ctrl+↓ |
Application Actions
| Action | Description | Default Key |
|---|---|---|
quit | Exit tv | Esc, Ctrl+c |
no_op | Do nothing (use it to unbind a default key) | - |
Custom Actions
Define custom actions in channels using the actions: prefix:
[keybindings]
ctrl-e = "actions:edit"
ctrl-o = "actions:open"
[actions.edit]
description = "Edit file"
command = "nvim '{}'"
mode = "execute"
[actions.open]
description = "Open in default app"
command = "xdg-open '{}'"
mode = "fork"
Action Modes
| Mode | Behavior |
|---|---|
fork | Run command, return to tv when done |
execute | Replace tv with the command |
Multiple Actions
Bind multiple actions to a single key:
[keybindings]
ctrl-r = ["reload_source", "go_to_input_start"]
Actions execute in sequence.
For example, to have Tab toggle the current entry and move to the next one (fzf-style):
[keybindings]
tab = ["toggle_selection", "select_next_entry"]
backtab = ["toggle_selection", "select_prev_entry"]
Reserved Actions (Internal)
These actions are used internally and cannot be bound:
| Action | Purpose |
|---|---|
render | Trigger UI render |
resize | Handle terminal resize |
clear_screen | Clear terminal |
tick | Application tick |
suspend | Suspend application |
resume | Resume application |
error | Display error |
Example Configurations
Vim-style Navigation
[keybindings]
ctrl-j = "select_next_entry"
ctrl-k = "select_prev_entry"
ctrl-d = "select_next_page"
ctrl-u = "select_prev_page"
Note: Single character keys like
jandkcannot be used for navigation as they are captured as search input. Use modifier keys (Ctrl, Alt) for navigation bindings.
Emacs-like Input
These are already the defaults:
[keybindings]
ctrl-a = "go_to_input_start"
ctrl-e = "go_to_input_end"
ctrl-u = "delete_line"
ctrl-w = "delete_prev_word"
Quick Actions
[keybindings]
ctrl-y = "copy_entry_to_clipboard"
ctrl-r = "reload_source"
f5 = "reload_source"