cx global variable provides read-only access to the current application state.
Structure
Active Tab
cx.active provides information about the currently active tab.
cx.active.current
Current directory view.
Fields
cwd(Url) - Current working directoryhovered(File|nil) - Currently hovered filefiles(File[]) - All files in directorywindow(File[]) - Visible files in current viewoffset(number) - Scroll offsetcursor(number) - Cursor position (0-based)
cx.active.preview
Preview pane state.
Fields
skip(number) - Preview scroll positionfolder(Folder|nil) - Folder preview state (if previewing a folder)
Folder Fields
cwd(Url) - Folder URLfiles(File[]) - Files in folderwindow(File[]) - Visible files in previewoffset(number) - Scroll offsetcursor(number) - Cursor position
cx.active.selected
Map of selected files.
cx.active.pref
Tab preferences.
cx.active:history(url)
Get history entry for a URL.
Url
required
Directory URL
Folder|nil
Cached folder state, or nil
Tabs
cx.tabs is a list of all tabs with additional properties.
Tab Fields
Each tab has the same structure ascx.active:
current- Current directory viewpreview- Preview stateselected- Selected filespref- Tab preferencesname- Tab name (string)
Tasks
cx.tasks provides access to the task manager state.
cx.tasks.summary
Task summary information.
Summary Fields
running(number) - Number of running taskstotal(number) - Total number of tasksfound(number) - Files foundprocessed(number) - Files processedpercent(number) - Overall progress (0-100)
cx.tasks.snaps
List of task snapshots.
cx.tasks.cursor
Current task cursor position (0-based).
Yanked Files
cx.yanked contains information about copied/cut files.
Yanked Fields
is_cut(bool) - True if cut (move), false if copy[url]- Map of yanked file URLs
Which-Key
cx.which provides state for the which-key component (when active).
Layer
cx.layer indicates the current UI layer.
"mgr"- File manager"help"- Help screen"input"- Input prompt"confirm"- Confirmation dialog"which"- Which-key screen"pick"- Picker dialog