Skip to main content

Actions Reference

This document provides a 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"
ActionDescriptionDefault Key
select_next_entryMove selection down, Ctrl+n, Ctrl+j
select_prev_entryMove selection up, Ctrl+p, Ctrl+k
select_next_pageMove down one page-
select_prev_pageMove up one page-

Selection Actions

ActionDescriptionDefault Key
confirm_selectionSelect current entry and exitEnter
toggle_selection_downToggle selection, move downTab
toggle_selection_upToggle selection, move upShift+Tab
copy_entry_to_clipboardCopy entry to clipboardCtrl+y

Input Editing Actions

ActionDescriptionDefault Key
delete_prev_charDelete character before cursorBackspace
delete_next_charDelete character after cursorDelete
delete_prev_wordDelete previous wordCtrl+w
delete_lineClear entire inputCtrl+u
go_to_prev_charMove cursor left
go_to_next_charMove cursor right
go_to_input_startMove cursor to startHome, Ctrl+a
go_to_input_endMove cursor to endEnd, Ctrl+e

Preview Actions

ActionDescriptionDefault Key
scroll_preview_upScroll preview up one line-
scroll_preview_downScroll preview down one line-
scroll_preview_half_page_upScroll preview up half pagePageUp
scroll_preview_half_page_downScroll preview down half pagePageDown
cycle_previewsCycle through preview commandsCtrl+F

UI Toggle Actions

ActionDescriptionDefault Key
toggle_previewShow/hide preview panelCtrl+o
toggle_remote_controlShow/hide channel pickerCtrl+t
toggle_helpShow/hide help panelCtrl+h
toggle_status_barShow/hide status barF12
toggle_layoutSwitch portrait/landscapeCtrl+l
toggle_action_pickerShow available actionsCtrl+x

Channel Actions

ActionDescriptionDefault Key
cycle_sourcesCycle through source commandsCtrl+s
reload_sourceReload current sourceCtrl+r

History Actions

ActionDescriptionDefault Key
select_prev_historyPrevious history entryCtrl+
select_next_historyNext history entryCtrl+

Application Actions

ActionDescriptionDefault Key
quitExit tvEsc, Ctrl+c

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

ModeBehavior
forkRun command, return to tv when done
executeReplace 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.

Reserved Actions (Internal)

These actions are used internally and cannot be bound:

ActionPurpose
renderTrigger UI render
resizeHandle terminal resize
clear_screenClear terminal
tickApplication tick
suspendSuspend application
resumeResume application
errorDisplay error
no_opNo operation

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 j and k cannot 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"

See Also