Modes
Mouser has two kinds of modes: mode plugins (commander, below), which change how you work with the files under the shell, and the input modes of the command line.
Input modes
Mouser supports vim-style input modes:
- Shell (default): input goes to the PTY.
- Command:
:command line for actions (e.g.,:open-sidebar,:connect <name>,:theme <name>). Tab completes command names and arguments (paths, theme names, connections); repeated Tab cycles matches, Shift+Tab goes back. - Config: reserved for in-app editing of preferences/themes.
Mode switching
- Enter Command: F10 by default (configurable in future). Esc returns to Shell.
- Mode indicator: the command line is shown at the bottom when in Command mode.
Actions
:open-sidebar/:close-sidebar:list-conns,:connect <name>:theme— open the theme switcher;:theme <name>— switch theme (saved):mode dark|light|system— switch variant mode (saved):edit-theme— open the theme & font editor for the active theme variant:font-size <6-48>,:font <family>(:fontalone resets to the default stack)
Keybindings
- F10: command line. Alt+Esc: toggle the connections sidebar.
- Ctrl+= / Ctrl++ bigger font, Ctrl+- smaller, Ctrl+0 reset to
config.toml's size (saved topreferences.toml; the grid reflows and the shell is resized). - Theme switcher: ↑/↓ theme (live preview), ←/→ or d/l/s mode, e editor, Enter apply, Esc cancel.
- Editor: Tab completes the focused field (repeated Tab cycles matches, Shift+Tab goes back); ↑/↓ still move between fields. Type to edit (live preview when valid), Ctrl+S save, Esc cancel. Fields are also clickable. Long font family names in the dropdown end in an ellipsis and keep padding so they never run into the edge. A validation message (for example an invalid font size) has its own row above the Save/Cancel/Dropper buttons.
Menus, keybindings and the command line dispatch the same named actions.
Mode plugins
Built in: commander (esc :c), chat (esc :a) and preferences (esc :p, preferences.md).
The last mode is remembered
When a window closes, Mouser saves the mode it was in (or none if no mode was on) to
$MOUSER_HOME/state/last-mode (state, not configuration), and the next launch starts in
it. With several windows, the last one to close wins. A remembered mode that has since
been disabled or uninstalled is skipped quietly (no mode). Restoring only switches the
mode: the chat starts empty and sends nothing, and no model is picked or downloaded until
you use it. Delete the file to go back to the default (the first enabled mode).
Exactly one mode plugin is active at a time (or none). Mouser starts in the default
mode, commander. Switching replaces the current mode; there is no stacking.
The second official mode is chat (esc :a), the agent; see docs/chat.md.
Since 1.4.0 no mode is compiled into Mouser: commander, chat and preferences are
plugin programs (mouser-commander, mouser-chat, mouser-preferences) that
first run installs from plugins.lock (signed, checked; the -full release
bundles carry them for offline installs; docs/downloads.md).
The modes are plugins (P6): the switcher lists the enabled modes from the plugin
registry in priority order, and the first is the default. mouser plugin disable commander (or chat) takes one out; with every mode off Mouser is a plain terminal.
Installed mode plugins (kind = "mode" over the command transport, with a
[mode] hotkey) join after the official modes; see docs/plugins.md §Mode plugins and
examples/plugins/hello-mode.
esc :then the mode's hotkey and Enter switches to it (esc :c= commander).- After
esc, Mouser waits 1200 ms for the:(was 500 ms before 1.0.1). Set it inpreferences.tomlwith[keys] leader_timeout_ms = 1500(100–10000). If the time runs out, or another key comes first, the Esc goes to the shell ahead of that key, in order. Once:is caught, the command line stays open until Enter or Esc, however slowly you type. On the alternate screen (vim, less) Esc is never held. Typing the hotkey of the mode that is already on turns modes off (plain terminal);esc :cagain turns commander back on.:c/:commanderwork from F10 too. - A lone Esc waits 500 ms for the
:; without it the Esc goes to the shell unchanged (soesckeeps working in readline/vi-mode shells, just 500 ms later).alt+:opens the command line at once. A line whose first word is not a Mouser command runs in the tab's shell (typed like commander's pipe: what you had typed is kept and comes back), soecho "hello, world!"just works; in an SSH tab it runs remotely. Mouser commands win on a name clash; a leading!forces the shell (!themeruns a program called theme). If another program owns the terminal the line is not typed and a notice says so. Esc first closes an open mode window or search. - Full-screen programs (the alternate screen: vim, less, htop ...) get the whole window: the mode's view is hidden and no key is taken, Esc included.
ctrl+shift+k: Keyboard help, every key of the current mode, Mouser's own mode keys and the global keys, with what each does (?or F1 while commander has the keyboard opens the same window).ctrl+shift+m: all modes (click one to switch).- Focus. A mode never takes a key from the shell on its own. Without focus every
key goes to the shell untouched; the mode binds one key only, the focus toggle
ctrl+alt+k. The toggle, a click in the mode's view, or switching to the mode
with
esc :gives it the keyboard: an accent ring round the view and a hint (commander has the keys · s sync · / search · …) show it. While it has focus its keys are plain (arrows, Enter, Space, letters) and nothing you type reaches the shell. Esc (after closing whatever is open),qwith nothing left to close, or the toggle again give the keyboard back; the hint then readsctrl+alt+k: keys to commander. F10 and Alt+Esc stay Mouser's. The same model applies to every mode (commander, chat, preferences and mode plugins). - Why ctrl+alt+k: bash (readline), zsh (zle) and fish bind none of it in their default emacs keymaps (alt+letters, alt+arrows/Enter/Backspace and most ctrl+alt letters are taken; ctrl+alt+f is bash's shell-forward-word), and no desktop reserves it (GNOME, KDE, Windows and macOS keep Ctrl+Alt+T/L/D/Delete, the arrows and F-keys). A test holds the shells' default tables and fails if the toggle collides. On Windows Ctrl+Alt is also AltGr: if AltGr+K types a character on your layout, remap the toggle.
Remapping
~/.mouser/modes.toml (the Mouser home), one section per mode:
[focus]
key = "ctrl+alt+k" # the toggle: alt+<key> or ctrl+alt+<letter>, never plain
[commander.keys]
switch_view = "t" # a character, up / down / left / right / enter / tab / space /
# backspace / pageup / pagedown / home / end / f1, alt+<key>, ctrl+alt+<letter>
Every key is rebindable. An unknown action or key is reported in the status bar and
the defaults are kept. The old modifier = "alt" setting is ignored (keys are plain
while the mode has focus).
Panel size and fullscreen
While a mode has the keyboard, Mouser itself takes four plain keys (before the
mode's own; [host.keys] in modes.toml):
| Key | Action |
|---|---|
F (Shift+F) |
mode panel fullscreen on / off (also the ⤢ button at the panel's bottom left) |
] |
panel taller (10% of the terminal per press) |
[ |
panel shorter (never below a tenth, or four rows) |
. |
context menu for the selected item |
Drag the panel's bottom edge (the pointer turns into ↕) to resize it with the
mouse. The size is saved in preferences.toml as [window] dock_height (a
percentage, 10–100) and dock_full, so it survives restarts. Fullscreen hides the
shell behind the panel; the terminal keeps its size, so nothing reflows. None of
these keys reach the shell's bindings: they only work while the mode has focus
(ctrl+alt+k). While a search or text field is focused they are typed instead.
One-character keys are case sensitive in modes.toml (F is Shift+F, f is f).
Keyboard help
? (or F1) while a mode has the keyboard, or ctrl+shift+k from anywhere, opens
Keyboard help: a window listing every key and what it does, in three groups:
the current mode's keys (your modes.toml remaps included), Mouser's keys while a
mode has focus (F ] [ .) and the global keys (F10, Alt+Esc, esc :, tabs,
clipboard, font size, mouse). It is built from the live key tables each time it
opens, so it can never disagree with what the keys do. ↑/↓, PgUp/PgDn and
Home/End scroll it (x–y of N at the bottom when it does not fit); ?, q, F1
or Esc close it. While it is open other keys wait (F10 and Alt+Esc still work).
A mode plugin gets it for free: its [[mode.keys]] are listed with their
describe text (an action called keys or help that answers show_keys opens
it, as commander does).
Context menus
Right-click in a mode's view (or press .) for a menu of every action that
applies right now: the item under the pointer (file, folder, image, media ...)
and the view's state (list, fullscreen image, playing clip, text viewer). Each
row shows the action's current key, so the menu also teaches the keys. The menu
is built from the same action registry as the key bindings, so a new or
remapped action shows up automatically. ↑/↓ and Enter pick, a row's own key
picks it, Esc or a click elsewhere closes it. Disabled actions are shown muted.
Modes answer menu.open with their entries (see docs/mode-protocol.md); a mode
that does not gets no menu.
Commander's menus (keys are the defaults):
| Where | Entries |
|---|---|
| a file | open (Enter), copy (y), copy to… (c), move to… (M), rename… (r), delete… (d), copy path (Y), mark (Space), pipe (|), back (u) |
| an image, video or audio file | the same, with play (Enter) and play / view fullscreen |
| a folder | open (Enter), sync the shell here (e), the file entries, paste (p), back (u) |
| the empty area | back, sync (s), new folder… (n), paste (p), sort by name / modified / size (N / D / S), reverse (R), list / grid / carousel (L / G / C), switch view (v), larger / smaller tiles (z / x), dotfiles (h), search (/), mark all (*), first / last, options (o), manual (m), keyboard help (?) |
| image view, fullscreen or not | zoom in / out (= / -), fit (0), 100% (1), pan (arrows; ← / → step images when not zoomed), fullscreen / exit fullscreen (f), copy path, close (q) |
| player, fullscreen or not | play / pause (k), back / forward 10 s (j / l), volume (- / =), fullscreen / exit fullscreen (f), copy path, close (q) |
| text, Markdown, PDF or document view, the manual | scroll (↑ / ↓), page up / down, previous / next file (← / →), copy text (T), copy path (Y), close (q) |
File changes never happen straight away: copy to, move to, rename and new folder
first ask for the destination or name in commander's prompt line. Tab completes
paths (relative to the current folder, with ~ expansion; directories get a
trailing slash) and names; repeated Tab cycles matches, Shift+Tab goes back.
Enter goes on,
Esc cancels), then every change (delete and paste too) waits for your yes on
Mouser's approval card, which lists what will change. Nothing is ever
overwritten: a target that exists stops the change. Delete is permanent (folders
with everything in them); the card says so. copy remembers the items for
paste in another folder; copy path and copy text put text on the
clipboard. In an SSH session the changes run on the remote host (the card
says on user@host), over the session's own ssh connection, with the same rules
(nothing overwritten, a folder never moved into itself); paste between this
machine and a remote one is refused. The commander plugin declares files.write
for them. The text view has no zoom of
its own (use Mouser's font size, ctrl+= / ctrl+-).
Commander
A view docked above the prompt (the terminal grid moves down; about half the
window) that starts in the shell's working directory (/proc/<pid>/cwd on Linux,
OSC 7 elsewhere) and keeps its own folder after that: browsing in commander never
types into the shell or changes its folder (s syncs, below). A cd you type in
the shell still moves commander there. Header: the directory,
item count and the equivalent ls flags, then the view, options, man and help
buttons; a search field filters the folder as you type.
Keys while commander has the keyboard (ctrl+alt+k or a click; plain keys, all remappable):
| key | list | grid | carousel |
|---|---|---|---|
| v | switch view: list → grid → carousel | ||
| L / G / C | list / grid / carousel view | same | same |
| ? or F1 | keyboard help: every key and what it does (above) | same | same |
| ↑ / ↓ | previous / next row | row above / below (follows the wrap) | previous / next item |
| ← / → | previous / next item | previous / next tile | previous / next item |
| PgUp / PgDn | a screen of rows | a screen of tiles | 5 items |
| Home / End | first / last | first / last | first / last |
| u, Backspace | back: where you came from (like popd), else the parent folder; in the file view / player it closes the view |
same | same |
| Enter | open: a folder is browsed (the shell stays where it is), video/audio open the player (below), anything else opens the full-width file view (image or text; ↑/↓/PgUp/PgDn scroll it, ←/→ step through files) | same | same |
| q (or Esc) | close the file view / window; with nothing open, back to the shell | same | same |
| / | search: type to filter (the first match is selected), Enter keeps the filter, Esc clears it | same | same |
| space | mark / unmark the item (then moves on in list and carousel) | same | same |
| * | mark all / clear marks | same | same |
| | | pipe: a prompt in the view; Enter types printf '%s\n' <paths> | <cmd> into the shell, so the output lands in the shell |
same | same |
| z / x | larger / smaller tiles | ||
| h | dotfiles on/off (ls -a) |
same | same |
| o / m | options window / manual | same | same |
| i | the header's ••• menu when narrow |
same | same |
| ctrl+alt+k or Esc | give the keyboard back to the shell | same | same |
| s | sync: move the shell to commander's folder (silently; see below) | same | same |
| e | sync the shell to the selected folder | same | same |
| O | open the selected image or video fullscreen | same | same |
| y / p | copy the marked (or selected) items / paste them here (approval card) | same | same |
| c / M | copy to… / move to… (asks for the folder) | same | same |
| r / d / n | rename… / delete… / new folder… (approval card) | same | same |
| Y / T | copy the path / the text of the file view to the clipboard | same | same |
| N / D / S / R | sort by name / modified / size, reverse | same | same |
Every entry of commander's menus has a key (a test fails if one does not), and the keyboard help lists them all. Upper-case letters are Shift+letter, so they never clash with the plain keys.
Back works like popd, inside commander (it never runs pushd/popd). Entering a
folder or opening a file pushes where you were onto a navigation stack: the path as
you saw it (a symlink stays a symlink), the selection and the scroll. Back pops it
and puts you exactly there again. With nothing on the stack (after a cd you typed,
a breadcrumb jump, or at startup) back goes to the parent of the path you see, not
of the resolved one, so leaving a symlinked folder never lands in its target's real
parent. Remote (SSH) folders work the same way (listed over the ssh side channel,
never by typing into the remote shell).
Sync (s). The shell's prompt stays as it is while you browse. s moves the
shell to commander's folder, from anywhere in commander (the file view and player
included), without leaving it. It never types: no cd on the line, nothing in the
history, the half-typed line kept. How it gets there:
| shell | how |
|---|---|
bash 4.4+, zsh, fish with mouser shell-integration |
idle at the prompt: at once, through the integration's silent cd (Fuzzball s c, docs/protocol/shell.md), prompt redrawn in place; running a command: at its next prompt |
PowerShell with mouser shell-integration pwsh |
at the next prompt: the prompt function reads the folder from its sync file and runs Set-Location (PowerShell only redraws its prompt after a command; Enter on an empty line takes it at once) |
| no integration (bash older than 4.4, other shells, a remote shell without it) | nothing happens; the status bar says so |
Both keys are rebindable in modes.toml (sync, search).
Player. Video and audio open in commander's own player (MODES.md: "a player will
appear"). Video frames are decoded by ffmpeg to RGBA, fitted to the view's width and
drawn through Mouser's image path; Mouser plays the sound itself (cpal: ALSA/PipeWire on
Linux, CoreAudio, WASAPI). Audio files get a minimal view: name, progress bar, time,
volume and the keys. Keys (plain, remappable, while commander has the keyboard; they
only act while a player is open):
| key | |
|---|---|
| k (Space in fullscreen) | play / pause |
| j / l | back / forward 10 s |
| - / = | volume down / up (10 %) |
| q or Esc | close |
| f | fullscreen (below) |
How it stays in sync: two ffmpeg readers of the same file start at the same seek point,
one for video (-an, RGBA at the file's frame rate, each frame stamped with its PTS =
start + n/fps) and one for audio (-vn, f32 at the device rate). The audio output
callback counts the samples it hands to the device and notes when each buffer was
handed over; the clock is the frame being played now: that buffer's first frame plus the
time since, minus the device latency the backend reports (so it moves smoothly instead of
in buffer-sized steps), never past what the device was given. Frames can only appear
when the window redraws, so the clock is read half a redraw interval ahead (measured as
a moving average): the error is centred on zero. A due frame is shown unless it is
already a whole frame late and the next one is due too; only then is it dropped; early
frames are held. Files without audio use a wall clock. Pause silences the output and
freezes the clock (the readers just wait, nothing restarts); volume is applied to the
samples in-process. A seek flushes both queues and restarts both readers with -ss at
the target, so audio and video start together. Measured (Linux, 25 fps test file with a
flash and a beep each second, 64 s of play plus 7 seeks, 2350 frames): video vs the
audio clock mean -0.2 ms, p95 9.5 ms, max 24.7 ms, 0 frames dropped, no drift
(first 10 s +0.5 ms, last 10 s -2.9 ms); 61-76 ms from a seek key to the first new frame.
MOUSER_PLAYER_LOG=<file> writes clock pts per shown frame and the seek gaps.
Nothing is started until a file is opened; playback stops (the readers are killed) when
the viewer closes, another file is shown or the mode is left. Without ffmpeg and
ffprobe on PATH, media falls back to the desktop opener (xdg-open, open on macOS).
What you have typed is kept. Pipe runs without losing a half-typed command: Mouser sends Ctrl+E, a space and Ctrl+U (the line goes to the shell's kill ring), the command and Enter, then, once the shell is the terminal's foreground process again (the command finished), Ctrl+Y and Backspace to put the line back (the cursor ends at its end). The added space makes sure an empty line stays empty instead of yanking an older kill.
| shell | |
|---|---|
| bash (readline, emacs mode) | kept (tested) |
| zsh (zle, emacs keymap) | kept (tested) |
| fish | kept (Ctrl+U/Ctrl+Y use its kill ring; tested when installed) |
vi keymaps (set -o vi, bindkey -v) |
not supported: in insert mode Ctrl+E/Ctrl+Y differ; leave the line empty before opening |
a program reading the terminal (less) after pipe |
the yank waits until it exits |
On Windows the shell's foreground state cannot be read, so the line is put back after a short pause.
Mouse in every view: a click selects, a double-click (400 ms) opens, the wheel moves the
selection (it scrolls the file view and the manual). The selection is highlighted and
the view scrolls to keep it on screen. Marks show as * and as a count in the header.
Pipe takes the marked paths in listing order, or the selected path when nothing is
marked; paths are single-quoted (' becomes '\''). Marks are per folder.
Commander takes no key from the shell: without focus it binds only the toggle, so alt+t, alt+f, alt+Backspace and the rest stay the shell's. Clicks: a click selects an item, a second click opens it; the wheel over the view moves the selection.
. and .. are never listed. Going up is the back control in the header
(‹ back (u), ‹ back when narrow; greyed out at /), u or Backspace (both
remappable, both in ctrl+shift+k). Going up selects the folder you
came from. The header path is clickable: each segment goes to that folder (long paths
lose their leading segments to …).
Search (/ or a click on the field) takes the typed letters while it is open
(bright field, "searching · type to filter" hint). Tab completes matching names
in the folder. It filters as you type and shows
N matches for "q" or no matches for "q"; Enter keeps the filter, Esc cancels.
Without focus everything you type, viewer or player open or not, goes straight to the
shell. An Esc right after an Esc that closed a viewer or window
(within 1.5 s) is swallowed instead of being held for the shell: held, it reached the
shell glued to the next key (Esc c is readline's meta-c), which ate the first letter of
what you typed next.
- List:
ls -lahcolumns (attributes, size, name, last modified). - Grid: tiles with a preview by type (images scaled, a frame of each video, the first lines of text files (Markdown rendered, Markdown rendering), a label for folders and audio) and the name below.
- Carousel: the focused item large in the middle and its two neighbours cut
off at the edges. Every item's name floats over its box in the same place
(near the bottom, centred): a slightly see-through rounded tag with a soft
shadow, drawn on top of the preview. Long names end in
…inside the tag. A folder shows a folder icon in the middle of its box, with its name tag under it. The date, size andn of Nare under the strip.
Type badges. Every grid tile and carousel item has a small round badge for
its type, centred exactly on the box's top-right corner and drawn on top of the
preview: a folder shape for folders, else a short mark (IMG image, VID
video, AUD audio, TXT text, </> code, MD Markdown, PDF, ZIP
archive, BIN binary or executable, {} JSON/TOML/YAML config, Aa font,
DOC document or spreadsheet, … anything else). The type comes from the file
extension (the same detection the previews use); a file with an execute bit and
no known type is a binary. Grid and carousel leave room above and between the
boxes for the overhang. The badges are drawn by Mouser itself (no image assets).
Previews load lazily on a worker thread: only what is on screen is requested
(grid: the visible tiles; carousel: the focused item and its two neighbours) and
the queue is replaced as you move, so off-screen items are skipped. They load in
order: grid tiles top-left first, the carousel's focused item before its
neighbours. Until one is ready the tile shows its kind dimly (image, ▶ video). If a
thumbnail of another size is already decoded (the grid used a smaller tile, or
the carousel is sliding a neighbour into view), that picture is shown instead of
the kind label so the tile does not flash.
Formats: PNG, JPEG, GIF, WebP, BMP. Video thumbnails: one ffmpeg frame at 10 % of
the duration (at most 30 s in; 1 s if unknown; the first frame if that fails), scaled
to the tile, cached in memory and on disk in $MOUSER_HOME/cache/thumbs/ keyed by
path, mtime, size and tile size. Without ffmpeg the tile says ▶ video.
Previews and player frames are clipped to the view (never over the prompt), and are left out under the options and manual windows so nothing shows through them.
Carousel motion. Moving between items slides the strip (the focused item and the partial neighbours together) over 180 ms with an ease-in-out curve (cubic; ease-in alone looked like it lurched at the stop). A key during a slide retargets from where the strip is, without a jump; jumps of more than 3 items only slide the last one. Redraws are requested only while it moves (a ticker every 8 ms, stopped at the end). Measured (Linux, release, 655 px window): 50 fps while sliding (frame p50 19.8 ms, p95 20.0, max 38.6), idle frames only on other events. Loading stays lazy: what is on the strip plus the selection's neighbours, so the incoming item loads during the slide.
SSH sessions. When the tab's shell is on another host commander lists that host:
- Remote when the terminal's foreground process is
ssh(typed, or the sidebar's launcher), or when an OSC 7file://host/pathnames a host other than this one while the local shell is not in the foreground. - Folder: nothing has to be set up on the host. An ssh started in a Mouser tab goes
through Mouser's ssh shim (ssh.md), which reports the remote login shell's
folder (OSC 7) and its process id (
OSC 1337;MouserRemoteShell=<pid>) as the session starts. Commander then follows that shell: each listing asks the host for the shell's current folder (/proc/<pid>/cwd, elselsof), so acdon the remote side moves commander too (checked every 2 s). Where that can't be read it uses the last OSC 7 (a remote shell that sends its own, e.g. withmouser shell-integrationinstalled there), else the remote home folder. - Listing:
ls -laon the host through a side channel:sshwith the running command's own connection options (-p -l -i -F -J -o -4 -6;-F $MOUSER_SSH_CONFIGif the command has none),BatchMode=yes(never prompts), multiplexed withControlMaster=auto,ControlPath=$MOUSER_HOME/cache/ssh/%C,ControlPersist=120. The ssh shim makes your interactive session that connection's master, so the side channel rides on the login you already did: password, one-time-code and passphrase-key hosts work without a second prompt. Fetched on a thread, refreshed every 2 s (5 s without a shell to follow) while shown. - File changes (copy, paste, move, rename, delete, new folder) run on the host over the same channel, after the approval card (above).
- Header:
user@host:/path(clickable segments, back works);cd, back and pipe are typed into the PTY, so they run remotely. - Previews are not fetched: tiles show their kind with a
· remotebadge. Opening a remote file (viewer or player) is not supported: a notice says so (pipe it into a command instead). - No folder at all (an ssh started outside Mouser's shim, before any OSC 7):
remote (host): no directory info ...with a hint; no side channel (mosh, a nested ssh):remote: no ssh side channel ...; the side channel failing (a session that does not share its connection,MOUSER_SSH_SHARE=noor your own ControlMaster settings, on a password-only host): ssh's error and a hint. Local files are never shown for a remote shell. Afterexitthe local shell is back and so is its folder.
Image zoom, player controls, header menu
- Image view:
=/-zoom (they are the player's volume keys too: in the image view they zoom, in the player they change volume; remapzoom_in/zoom_outto split them),0fit,1100%. Ctrl+wheel zooms about the pointer; when zoomed, drag, the arrows or the wheel pan. The header showsfit 37%/200%. Past 2048 px the full image is decoded (the preview shows until it is ready). Images stay inside the view and clear of its rounded corners (the renderers have no per-pixel clip, so images are inset rather than masked). - Player:
« 10s, play/pause and10s »buttons; the seek bar seeks on click, scrubs on drag (seeks at most every 120 ms, a final one on release) and shows the hovered time; the volume bar takes click, drag and wheel. Clicking the video toggles play. - Fullscreen:
f(fullscreen), the header'sfullscreen (f)button, or a double-click on the picture or video. Commander's image viewer or player then fills the whole window, local or remote. The shell, tab bar and sidebar are hidden, and the terminal keeps its size, so nothing is resized under the shell. Esc orfagain leaves. Opening eases the picture from its thumbnail (or the docked preview) to fullscreen over about 220 ms (cubic ease-in-out, timed from the wall clock so a late frame does not jump); closing eases it back to that rect. A dim backdrop crossfades with it. The same thumbnail cache that stops the carousel flashing a placeholder is reused on close, so the landing tile is the decoded picture, notimage/▶ video. Setappearance.reduce_motion(Preferences → Appearance → Reduce motion) to skip the transition and toggle instantly.- Images are fitted whole and letterboxed on a dark backdrop, and keep zoom and pan. Video is letterboxed the same way and keeps play/pause, seeking and the clickable seek and volume bars.
- A title strip with
exit fullscreen, plus the player's controls for video, shows on entry and after any pointer move or key. It hides after 2.5 s, and the picture then takes the whole window. - Audio gets a centred full-window controls view, always shown.
- Keys while fullscreen: Space plays or pauses, ←/→ seek 10 s, ↑/↓ change the volume. In the image view the arrows step or pan. Commander's other keys still work; anything unbound is dropped (commander has the keyboard), never sent to the hidden shell.
- The view follows window resizes. Sizes are physical pixels, so HiDPI is sharp.
- The view is closed (and fullscreen dropped) by q, Back or opening something else.
- Header: when narrow, the path is elided first (down to ~16 columns), then the buttons that still do not fit go, one by one from the left, into a
•••menu (menu, defaulti). - Boxes: 8 px rounded corners and a three-layer soft shadow (stronger on dark themes, faint on light), built from rects so every renderer draws them.
Remote files (SSH sessions)
Remote listings preview, view and play like local ones, through mouser_core::fetch:
- Side channel: the session's own ssh options,
BatchMode, ControlMaster under$MOUSER_HOME/cache/ssh(MOUSER_SSH_CONFIGfor Mouser's config,MOUSER_SSH_BINto swap ssh in tests). - Reads:
tail -c +N | head -c Lranges, 3 at a time per file, 3 files at once (others queue). The first is the 256 KB head (image header, start of text, video start); after that 2 MB chunks from the priority offset, wrapping. Seeks (player, through a local HTTP Range server ffmpeg reads) and scrolls (text) move the priority. - Cache:
$MOUSER_HOME/cache/remote/<key>.data(sparse) +.map(filled ranges); key = host + path + size + mtime, so an unchanged file is never fetched again. LRU-trimmed toMOUSER_REMOTE_CACHE_MB(2048). - When nothing shows a file any more its reads stop; files up to
MOUSER_REMOTE_COMPLETE_MB(64) finish into the cache: rsync--inplace(when both ends have it; what is cached is not resent), else scp, else the ranged reads.MOUSER_REMOTE_BACKEND=rsync|scp|catforces one. - Thumbnails: the host's ffmpeg makes a small PNG (only that crosses); without it images are fetched whole (up to 64 MB for tiles) and videos decoded locally from ranged reads. Cached in
cache/thumbs. - Viewer: the header bytes give the size at once; a 1024 px preview shows scaled up, the full image replaces it when fetched; a status line shows progress or the error. Text shows what has arrived and grows.
- Measured on a localhost sshd throttled to 4 MB/s per read: 33 MB 8000x6000 JPEG header 0.1 s, first preview 0.65 s, full 3.4 s; 153 MB 1080p video (moov at the end) first frame 1.7 s, seek to an unfetched 90 s 1.3 s, all here 12.9 s; A/V offset p5 -3.5 / p95 4.0 ms.
- Future: the fetch layer (range map, cache keys, backends, transfer queue) is its own module so a local<->remote sync can reuse it; sync itself is not built.
- Images fit the terminal's width (default and
0).
Scroll position
When a view doesn't fit, commander shows where you are: a slim scrollbar on the right of the list, grid and text views, and x–y of N (text: lines x–y of N) at the right of the search row. The carousel shows n of N and a track under the picture.
As a plugin program
Commander is a separate program (mouser-commander, transport = "mode", source in
plugins/commander and the WeirdBrains/mouser-commander repo), built only on
mouser-mode-api; Mouser has no built-in commander since 1.4.0. It runs as
you, like any program you start: it lists the folder and decodes thumbnails and
previews itself, and its view goes to Mouser with the images inline (sent once,
then reused by key). It needs files.read (to be told the shell's folder) and
shell.type (sync, pipe, and keys it passes on), and remote.read for remote
shells (Mouser tells it the ssh session and the folder's listing; it fetches
previews and files over that session's ssh, below):
cargo build --release -p mouser-commander
mkdir -p /tmp/commander-plugin && cp plugins/commander/plugin.toml target/release/mouser-commander /tmp/commander-plugin/
mouser plugin install /tmp/commander-plugin
mouser plugin permissions commander run=allow files.read=allow shell.type=allow remote.read=allow
mouser-commander --manifest prints its plugin.toml. Keys, remaps in
modes.toml, the views, search, pipe, the file view with Markdown, and image
zoom are tested end to end: plugins/commander/tests/through_mouser.rs starts the
program through Mouser's adapter and checks what it draws (list, grid, carousel,
search, the file view, images) and the effects it asks for (sync's cd, pipe's
command line); remote_through_mouser.rs does the same for a remote folder over a
fake ssh (list, grid tiles and snippets, the image and text views). A bound key the
mode passes on (k with no player) goes nowhere (commander has
the keyboard, so nothing is typed into the shell)
let it through. The player runs in the plugin too: it starts ffmpeg itself, plays the
audio, and hands each frame to Mouser through shared memory
(player_through_mouser.rs: a 1280x720 60 fps clip arrives at 61.5 fps through
Mouser, debug build on Linux; the test's floor is 30, 20 on CI).
Plugin API (mouser_render::modes)
A mode implements the Mode trait and is registered with Host::new (the first
mode is the default). Mouser registers the enabled mode plugins with
Host::from_registry; tests register their own modes with Host::new.
| item | what the mode provides |
|---|---|
name(), hotkey() |
name and the letter typed after esc : |
bindings() |
default bindings Binding { id, key, describe }; the host loads modes.toml overrides, shows them in ctrl+shift+k and routes a bound key to action(id, 0) |
activate(), deactivate() |
lifecycle; deactivate drops transient state |
cwd_changed(dir) |
the shell's directory (called every frame; cheap when unchanged) |
action(id, arg) |
a bound key, or a click on an item with UiAction::Mode { action, arg }; the wheel over the view sends "scroll" with ±steps |
wants_text(), text(bytes) |
a focused input (search) takes plain typing |
escape() |
close the mode's window or input |
view(ctx, keymap) |
the render contribution: View { dock, panel, images } — a panel docked above the prompt inside ctx.area, an optional floating window and images (window pixels plus source rect) |
set_waker(w) |
redraw from another thread (e.g. when a preview finished) |
Actions return an Effect for Mouser to carry out: Type text into the shell,
Open a file with the desktop opener, ShowKeys, Say (status bar). The core
has no commander-specific code: key routing, esc :, the key and mode windows and
remapping are generic.
The interface passes plain data only (ids, paths, panels, pixels), so it can be served across a C ABI or a socket later.
Future work: third-party modes, loaded like engines (a shared library with a
versioned ABI or a helper process speaking the same calls), installed under
~/.mouser/modes/; DJ, Director, Debugger and Artist
from MODES.md.
Source: docs/modes.md