Tabs
Every Runlet window holds tabs, and each tab has its own code and its own target. A tab is a PHP tab, an SQL tab, a Redis tab, or a MongoDB tab.
Tabs are saved with your session and come back after a relaunch. Restoring a tab never runs its code: nothing runs until you press Run.
Horizontal and Vertical Tabs
Runlet shows tabs in one of two layouts:
- Horizontal: a tab bar above the editor. Each tab shows its target's icon and its title, a badge for SQL, Redis, and MongoDB tabs, PRODUCTION for a production target, a spinner while it runs, and a close button. Drag a tab along the bar to reorder the tabs.
- Vertical: a sidebar of tab cards. Each card shows the target, its runtime and PHP version, and the framework or
.runletdriver of the last run. Drag a card to reorder the tabs, and drag the sidebar's edge to resize it.
To switch layouts, choose View ▸ Toggle Vertical Tabs (⌃⌘T), click the toolbar button, or change Settings ▸ General ▸ Tabs. The layout applies to every window.
Working With Tabs
| Action | How |
|---|---|
| New tab | File ▸ New Tab (⌘T), or + in the tab bar or the sidebar. The File menu also has New SQL Tab, New Redis Tab, and New MongoDB Tab. |
| Rename | Double-click the tab, choose Rename… in its context menu, or Window ▸ Rename Tab…. See Renaming a tab. |
| Duplicate | Duplicate in its context menu, or File ▸ Duplicate Tab (⇧⌘D). |
| Close | The close button, Close in its context menu, or File ▸ Close Tab (⌘W). |
| Close the others | Close Other Tabs in its context menu, or Window ▸ Close Other Tabs. |
| Close to the right | Window ▸ Close Tabs to the Right. |
| Reopen a closed tab | Window ▸ Reopen Closed Tab (⇧⌘T) brings back the last 20 closed tabs that had code. |
| Select | Click it. ⇧⌘] and ⇧⌘[ select the next and previous tab, ⌘1 to ⌘8 the tab at that position, and ⌘9 the last tab. |
| Pin or unpin | Pin Tab or Unpin Tab in its context menu, or Window ▸ Pin Tab. See Pinned tabs. |
| Reorder | Drag the tab along the tab bar, or its card in the vertical tabs. Move Tab Left and Move Tab Right in the command palette move the selected tab one place. See Reordering tabs. |
The tab bar and the vertical tabs share one context menu: Rename…, Duplicate, Pin Tab (or Unpin Tab), Switch to … for every other tab language, Close, and Close Other Tabs.
TIP
Every Window menu command is also in the command palette (⇧⌘P), and Settings ▸ Shortcuts can give any of them a shortcut.
Reordering Tabs
Tabs stay in the order you put them in, in both layouts: the tab bar and the vertical tabs show the same order, and it is saved with your session.
- In the tab bar, drag a tab left or right. It follows the pointer and is selected, and the tabs it passes slide aside to show where it will land. Release it to drop it there.
- In the vertical tabs, drag a card up or down, and drop it where the line shows.
- From the keyboard, run Move Tab Left or Move Tab Right from the command palette (⇧⌘P). They move the selected tab one place. They have no shortcut; Settings ▸ Shortcuts can give them one.
With more tabs than fit in the tab bar, hold the dragged tab near either end of the bar, and the bar scrolls that way. The closer to the end, the faster it scrolls.
A tab moves only when you drag it a few points. A click still selects it, a double-click still renames it, and the close button and the context menu work as usual. While you rename a tab, dragging in its field selects text.
A dragged tab stays in its group: a pinned tab moves among the pinned tabs, and any other tab among the others. Drag a tab toward the other group, and it stops at its own group's end. Tabs don't move between windows.
Renaming a Tab
Renaming works the same way in the tab bar, the vertical tabs, and pinned tabs in both layouts.
To start renaming, double-click the tab, choose Rename… in its context menu, or choose Window ▸ Rename Tab… for the selected tab. You can also run Rename Tab… from the command palette (⇧⌘P), or type "rename" in Open Anything (⌘P).
The title turns into a field with the whole title selected, so typing replaces it. Click in the field to place the caret or select a word; the click doesn't select the tab or start a drag. While you rename, keys go to the field, never to the editor, and ⌘W closes nothing.
| To | Press |
|---|---|
| Keep the new name | Return or Tab, or click anywhere else: in the editor, on another tab, or on an empty part of the tab bar. |
| Keep the old name | Esc. It does nothing else: it doesn't hide the output pane. |
Runlet trims the name, and an empty name keeps the old title. After Return or Esc, the editor (or whatever had the keyboard before) has the keyboard again.
Pinned Tabs
Pin the tabs you keep open all the time, such as a scratch snippet, a production SQL tab, or a Redis tab. Any kind of tab can be pinned, in both layouts.
Pinning a Tab
Choose Pin Tab in the tab's context menu, or Window ▸ Pin Tab for the selected tab (it shows a checkmark while the tab is pinned). The command palette has Pin Tab too, and Open Anything lists it when you type "pin" or "unpin". Pinning never runs anything.
Pinned tabs come first: leftmost in the tab bar, and at the top of the vertical tabs.
- Pinning moves a tab to the end of the pinned tabs; unpinning moves it to the start of the other tabs.
- New tabs open after the pinned ones, even when a pinned tab is selected.
- A dragged tab stays in its group. In the tab bar, a tab dragged toward the other group stops at its own group's end; in the vertical tabs, pinned and other tabs are separate sections, and a tab dropped past its group's end stays at that end. See Reordering tabs.
- ⌘1 to ⌘9 count the tabs as you see them, pinned tabs first.
How Pinned Tabs Look
- In the tab bar, a pinned tab is compact: its kind's icon in its colour (PHP, SQL, Redis, or MongoDB), a short title, and no close button. A spinner replaces the icon while it runs, a red dot marks a production target, and • an edited file. A separator follows the pinned tabs. Hover over one for its full title and target.
- In the vertical tabs, a Pinned section at the top lists them in one-line rows: the kind's icon, the title (with • when edited), the run state (a spinner, then the last run's status dot), and the target's colour stripe. There is no close button.
Closing a Pinned Tab
Pinned tabs are hard to close by accident:
- ⌘W asks first. Close Tab on a pinned tab shows a sheet, Close pinned tab?, that names the tab. Close (Return) closes it, and Cancel (Esc) keeps it. Pressing ⌘W again while the sheet is up cancels it. With a terminal focused, ⌘W still closes the terminal tab.
- Close Other Tabs and Close Tabs to the Right leave pinned tabs open, and are disabled when they would close nothing.
- Close in the tab's own context menu closes a pinned tab without asking, since you clicked that very tab.
⇧⌘T brings a closed pinned tab back pinned, at its old place among the pinned tabs (or as the last pinned tab, if fewer are pinned now). A reopened unpinned tab never lands among the pinned ones.
What Is Saved
Pins are saved with your session and in .runlet workspaces, and come back after a relaunch. Duplicate gives an unpinned copy. Pins belong to a window's tabs: tabs don't move between windows.