Skip to content

Panes and splits

Every tab holds one or more panes. Each pane is a real terminal running its own shell, emulated by Ghostty’s terminal core, so full-screen programs such as nvim, htop, fzf, lazygit and coding agents behave as they do in a regular terminal.

issue-482-returns-page-crashes-on-empty-addresissue-482-returns-page-crashescargo tests-on-empty-addressgit logCompilingweb-shop v0.5.0--oneline --graphFinishedtest profile in 2.41s*bf5e6d7 (HEAD->issue-482-Runningunittests src/main.rsreturns-page-crashes-on-empty-address)Add a test for emptrunning 7 testsy addressestest checkout::totals_include_tax ...ok*7e125d8 (main,feat/gift-catest checkout::coupons_stack ...okrds,feat/dark-mode)Releasetest returns::label_is_printed ...ok0.5.0test theme::dark_background_is_dark ...ok*0e41f29Explain how to runtest theme::light_is_the_default ...okittest returns::postcode_is_trimmed ...ok*6501897Start the returns stest returns::empty_address ...FAILEDerviceissue-482-returns-page-crashefailures:s-on-empty-address---- returns::empty_address stdout ----panicked at src/returns/address.rs:12:33:called `Option::unwrap()` on a `None` valueissue-482-returns-page-crashetest result:FAILED. 6 passed; 1 faileds-on-empty-addressgit statissue-482-returns-page-crashes-on-empty-addresus -sbs##issue-482-returns-page-crashes-on-empty-addressMsrc/returns/address.rsMsrc/returns/mod.rsissue-482-returns-page-crashes-on-empty-address
A tab split right, then down. The active pane is on the left; the others are dimmed.

Right-click inside a pane to open its menu:

split rightsplit downsend right-clicks to the paneopen in…close pane
Item What it does
split right Opens a new shell to the right of the pane.
split down Opens a new shell below the pane.
send right-clicks to the pane Lets the program in this pane have right-clicks; see below.
open in… Opens the folder the program in this pane is in, following your cd, in Finder or your file manager, or in an editor; see Open in another app. A window that can’t open anything shows copy path.
close pane Ends the program in this pane and removes it.

The new pane starts in the folder the pane you split is currently in, and becomes the active one. A split is only offered when both halves would still be usable: at least 10 columns wide or 3 rows tall each.

You can split a pane again and again; the dividers join up like in Ghostty. The tab keeps the name of its first pane, the top-left one, and its row ends with a grey +n, the number of other panes in it. When the program in a pane exits, the pane closes and its neighbour takes the space. Closing the last pane closes the tab.

Drag a pane with the right button to put it somewhere else in the tab. Press the right button in the pane, move onto another pane and release:

  • Near an edge of the other pane, the pane goes on that side of it: left, right, above or below. The half it would take is tinted and says move here.
  • In the middle of the other pane, the two swap places and the layout stays as it was. The whole pane is tinted and says swap.

The programs keep running; only their place and size change. The moved pane becomes the active one, and the new layout is saved with your session. Releasing on the same pane, outside the panes, or pressing Esc cancels. A place where the panes would no longer fit is not offered.

A right-click without moving still opens the pane menu, now when you release the button.

This is also how you turn two panes side by side into one above the other: drag one onto the bottom edge of the other. From a script, cornercase move-pane --pane 4 --target 7 --place below does the same (see Scripts and agents).

  • Click a pane to make it active. That first click only moves the focus; it is not sent to the program.
  • Drag a divider to resize the panes on both sides. It lights up cyan while you hover or drag it (in Ghostty, kitty and foot the mouse pointer turns into a resize arrow too, see The resize pointer), and stops where a pane on either side, including panes split inside it, would get smaller than 10 columns or 3 rows. Double-click a divider to split the space in half again.
  • Inactive panes are dimmed so you always know where your keys go. You can turn this off in settings → UI → inactive panes.

Programs are told about every size change, and Ghostty’s emulator reflows their output, so long lines rewrap instead of being cut.

When the terminal shrinks, for example when you attach from a phone, the panes shrink too, each down to 10 columns and 3 rows. If even that doesn’t fit, the tab shows only its active pane, over the whole tab, until there is room again. The other panes keep running at their last size, and the tab goes back to its splits, with the same proportions, as soon as they fit. Meanwhile the pane menu offers no split, and there is no other pane to move a pane to.

Every key goes to the active pane. Out of the box cornercase has no shortcuts of its own, so Ctrl+B, Ctrl+A, Alt combinations and function keys all reach your program. If you turn on a prefix key, only that key is taken: after it, | and - split, the arrows move between panes and x closes one.

Keys are encoded the way a modern terminal does it: when a program turns on the kitty keyboard protocol, cornercase speaks it, and it asks your own terminal for the same so that combinations like Shift+Enter and Ctrl+Enter keep their modifiers. See Keyboard and mouse for the details.

When the program in a pane asks for the mouse (htop, lazygit, nvim with mouse=a), cornercase sends it clicks, drags and the scroll wheel, in the encoding the program asked for and relative to the pane.

When the program doesn’t ask for the mouse, dragging selects text instead; see below.

Over a shell, or any program that doesn’t use the mouse, the wheel scrolls back through what the pane printed: each pane keeps its last 10 MB of output, as Ghostty does, which is about 14,000 lines in an 80-column pane and fewer in a wider one. It scrolls the pane under the pointer, even one that isn’t active, without moving the focus. While you are up in the history, ↓ n more at the bottom right of the pane says how many lines are below; new output doesn’t move what you are reading, the number just grows. Click ↓ n more, or type or paste in the pane, to get back to the bottom. Commands sent by scripts and agents (cornercase send, cornercase keys) leave the view where it is.

You can select and copy text up in the history, and click paths there, as on the live screen.

In full-screen programs that don’t use the mouse, such as less, man or git’s pager, the wheel sends the up and down arrows instead, so they scroll as in any terminal.

Right-clicks normally open cornercase’s pane menu, and right-button drags move the pane, even while a program uses the mouse, because almost no program needs the right button. For the ones that do, choose send right-clicks to the pane in the pane menu: from then on, right-clicks and right-button drags go to the program in that pane while it uses the mouse.

When the program stops using the mouse, a right-click opens the menu again, and the same item now reads use this menu on right-click to switch back. The choice belongs to that pane and is saved with your session.

When the program doesn’t use the mouse, press, drag and release over text to select it. On release, cornercase copies the selection to your clipboard and says so in a toast:

issue-482-returns-page-crasheAILED. 6 passed; 1 failedissue-482-returns-page-crasherns-page-crashes-on-empty-address-on-empty-addressgit status -sb##issue-482-returns-page-crashes-on-empty-addressMsrc/returns/address.rsMsrc/returns/mod.rsissue-482-returns-page-crashes-on-empty-addresscopied to clipboard

The copy goes through your terminal with the OSC 52 escape sequence, so it reaches your local clipboard even when cornercase runs on another machine over SSH.

Programs can copy too. When a program in a pane writes to the clipboard with OSC 52 (nvim’s OSC 52 clipboard, for example), cornercase passes the text on to your terminal and shows the same toast. Requests to read your clipboard, and writes to the primary selection, are dropped.

Paste with your terminal’s usual keys. cornercase hands the text to the program in the active pane, wrapped in bracketed-paste markers when the program asked for them, so shells and editors can tell a paste from typing.

While a dialog or the search is open, a paste goes into its text field instead.