# Mouse and copy (/docs/v0.4/using/mouse-and-copy)



Mouse support covers pane focus, border resize, scrollback, selection, and
clipboard copy. The mouse belongs to the terminal you are sitting at, so every
setting on this page is read from that terminal's own `koshi.kdl`.

## Focus and resize [#focus-and-resize]

Click a pane to focus it. Drag a pane border to resize the panes on either
side. A drag moves the border the whole distance in one step, so the layout
follows the pointer instead of trailing it a cell at a time.

Disable border dragging in `koshi.kdl`:

```kdl
version 1

mouse {
    border-resize #false
}
```

## Scrollback [#scrollback]

The wheel scrolls koshi's per-pane history by three lines per notch by default.

```kdl
version 1

mouse {
    scroll-lines 5
    wheel "scroll-scrollback"
}
```

Set `wheel "ignore"` to leave wheel input unused by koshi.

Typing while scrolled up returns to the newest line by default. Set
`scrollback.scroll-on-input #false` to keep the view parked while input still
reaches the pane. That one is read by the session, so it is the same for every
attached terminal.

## Select when an app owns the mouse [#select-when-an-app-owns-the-mouse]

Full-screen terminal programs can request mouse input. Press
<kbd>\<C-g></kbd> to toggle mouse-selection mode for the current client.
While enabled, a drag selects terminal text in koshi instead of going to the
program.

```bash
koshi actions explain core:mouse-select
```

Hold `Shift` while dragging to select text even when the program owns mouse
input. This does not enter mouse-selection mode.

## Copy [#copy]

Completing a selection copies through OSC 52. OSC 52 asks the outer terminal
to write the clipboard, so copying also works through SSH when that terminal
allows it. The copy is made where the selection was dragged, so it is that
terminal's `copy` settings that apply.

Trailing blanks are removed from copied lines by default:

```kdl
version 1

copy {
    trim-trailing-whitespace #true
}
```

Clipboard policy belongs to the outer terminal. If selection works but the
clipboard stays unchanged, check that terminal's OSC 52 setting.
