User guide / The screen

Mouse

Development reference · View source

Mouse support needs a terminal with mouse reporting and editor.mouse: true (the default).

ActionEffect
ClickFocus a pane and place the caret
Shift-clickExtend the selection
DragSelect, entering Select mode
Drag past the top or bottom rowScroll and keep extending
WheelScroll the pane under the pointer
Drag a shared borderResize the split
Right-click a selectionCopy all selections to the system clipboard, like Space c y
Double-click a directory tree rowToggle the directory or open the file, like Enter
  • Autoscroll follows visual rows, including soft wrapping and collapsed folds. Move back inside the pane or release the button to stop.
  • Right-click copy leaves the selections alone and reports right mouse click (yanked to system clipboard).
  • Character rule. The pointer names the character under it, not the gap before it, so a drag covers the characters it started and ended on, in either direction. Pressing past a line’s end places the caret on its last character, or past it in Insert mode, as keyboard motion does.
  • Terminal panes. A click focuses a live terminal in Insert mode; a reviewed terminal stays in Normal/review until a terminal insert key returns to the live screen. A left drag in review selects cells and enters Select mode, and right-click copies that selection. Clicking another pane focuses it in Normal mode. Dragging from a document press still selects and enters Select mode.
  • Pointer coordinates go through the same fold- and wrap-aware rows used for drawing, so collapsed lines and wide Unicode glyphs never disagree.
  • Passive pointer motion never clears key hints or status and does not redraw.
  • Mouse capture is released on every exit and error path.

Native text selection. Capturing the mouse takes over the terminal’s own text selection. To keep that instead, set editor.mouse: false and restart.