Skip to content

Ferret v3.1.1 - Pre-Release 2

Pre-release
Pre-release

Choose a tag to compare

@BonitoCat BonitoCat released this 20 Oct 09:50
· 17 commits to avalonia-upgrade since this release

Addons

Background services

  • Addons can define a service: script that starts with the window and keeps running in the background.
  • Ferret sends events to the service on stdin:
    • event:navigate <path>: at start and whenever the folder changes (also when switching split panes)
    • event:selection <paths>: tab-separated, sent 150 ms after the selection stops changing
    • event:click <id>: one of the service's status bar items was clicked
    • event:reply <text> / event:cancel: answers to dialogs the service opened
    • event:setting <id> <value>: a setting was changed
    • event:close: the service should exit now
  • Services stop when the window closes or the addon is disabled or uninstalled. After event:close, Ferret waits up to 2 s, then sends SIGTERM and finally SIGKILL.
  • "Reload Addons" (both the menu entry and the button in Manage Addons) restarts services.
  • A crashed service is not restarted automatically. A non-zero exit code is reported in Addon Problems, and its status bar items and sidebar places are removed.
  • Events go through a buffer, so Ferret never blocks on a slow service. If it falls more than 500 events behind, the oldest are dropped.
  • Services run in the addon folder with FE_SERVICE=1.

Status bar items

  • fe:statusbar <id> <text> adds or updates an item at the right of the status bar, shown with the addon's icon. Empty text removes it.
  • fe:statusbar-tooltip <id> <text> sets a tooltip (\n for line breaks).
  • Clicking an item sends event:click <id> to the addon's service. If the addon has no service, the click runs the action with the same id.

Sidebar places

  • New places: list in addon.yaml. Each entry has name, path (~/ supported), section (default: the addon name) and icon.
  • fe:place <section> | <name> | <path> [| <icon>] adds or updates an entry. fe:place-remove <section> [| <name>] removes entries.
  • Each addon section can be collapsed on its own, and all addon sections move together when the sidebar sections are dragged.
  • icon can be an image inside the addon folder or a built-in icon name.

Addon settings

  • New settings: list in addon.yaml. Supported types: text, password, number (with min/max), bool, choice, file, folder.
  • New Settings… button in Manage Addons, with Reset to defaults, Cancel and Save.
  • Values reach scripts as FE_SETTING_<ID> environment variables. A running service is notified of changes with event:setting.
  • fe:setting <id> <value> saves a value from a script.
  • Settings are stored in addon_settings.json in Ferret's data folder, survive updates, and are deleted on uninstall.

New dialogs

  • fe:choose <question> | opt1 | opt2 …: up to 6 options are shown as radio buttons, more as a drop-down. The reply is the chosen option.
  • Forms: fe:form <title>, then one or more fe:field <id> | <type> | <label> | <default>, then fe:form-show.
    • The reply is one tab-separated line in field order.
    • File and folder fields have a "…" button that opens Ferret's own picker.
    • For choice fields, mark the default with *.
  • Cancelling closes stdin for normal scripts and sends event:cancel for services.

Lifecycle hooks

  • post_install, pre_uninstall, post_load, post_start and pre_close, with time limits where needed.
  • FE_HOOK tells the script which hook is running.

Progress, loading and pickers

  • fe:progress … shows a progress bar. Its variants set the maximum, title, text, status and current item, or remove the bar with done.
  • Several running operations (addons and file copies) are shown as tabs you can switch between with the arrows. Copies now run in parallel.
  • Cancel sends SIGTERM to the script and everything it started, and kills them 3 s later if they are still running.
  • fe:loading on|off shows the thin loading bar above the file list.
  • fe:confirm, fe:select <pattern> and fe:pick <path> (finishes a file picker with that path).
  • modes: controls where an addon or action appears: explorer, file/folder/save picker, all pickers, or everywhere. FE_MODE tells the script which one it runs in.

Error reporting

  • New Addons → Addon Problems… dialog, plus a warning badge in the status bar (or next to the file name box in pickers).
  • It lists:
    • failed scripts, with their stderr output
    • scripts that failed to start
    • addon.yaml mistakes
    • unknown or invalid fe: lines
    • hooks that timed out
    • crashed services
  • The list has Copy All and Clear buttons.

New environment variables

Variable Value
FE_HOME_DIR your home folder
FE_CACHE_DIR ~/.cache (or $XDG_CACHE_HOME)
FE_DATA_DIR ~/.local/share/fe (or $XDG_DATA_HOME/fe)
FE_SERVICE 1 inside a background service
FE_SETTING_<ID> the value of each addon setting
FE_MODE explorer, file-picker, folder-picker or save-picker
FE_HOOK name of the running hook

Documentation

  • _docs/ADDONS.md is greatly expanded, with precise rules for every feature above.
  • The addon paragraph in README.md is updated.

Changes

  • Paste as symlink is now Ctrl+Alt+V (was Ctrl+Shift+V), to match Alt for dropping as a symlink. Ctrl+Shift+V in the file list now pastes normally.
  • Ctrl+Shift+V pastes in text boxes.
  • "Copy path to clipboard" works for files too. It copies all selected paths, or the current folder if nothing is selected.
  • Rubber-band selection starts on the first click, even when that click switches to the other pane, and the switching click keeps the existing selection.

Fixes

  • Firefox (and other apps using the portal file picker) showed no files when the filter used character classes like *.[jJ][sS][oO][nN].
  • A drag preview could get stuck after a script prompt dialog appeared.
  • Unselected files could stay gray after deselecting them.
  • Double-clicking opened the selected item instead of the one under the mouse. This made Ctrl+double-click open the wrong folder, and double-clicking empty space could open something.
  • Addon scripts whose background child processes kept stdout open could hang Ferret's exit handling.
  • Entering folders with the Enter key no longer worked