Why tabs, and why now?

mdpeek has always been "double-click to open, Esc to leave": one document at a time, a light window, a fast start, a clean taskbar. We stuck with that idea for a long time — and turned down a fair number of tab requests along the way.

Then the way people actually read changed. While reading a spec you usually have the API doc, the test plan and last week's version open too. While taking notes, the source material sits next to the draft. While editing with an AI, the original and the rewrite need to be compared. Windows pile up, Alt+Tab turns into a blur, and the taskbar ends up as a row of identical icons.

So 2.0 does it properly. We did not want "virtual tabs": switch over and the page re-renders, scroll position resets, a half-finished edit is thrown away. That is not a tab — it is a wrapper around "close this, open that". mdpeek gives every tab its own WebView, spending a little memory to buy a real, in-place switch.

Turning it on

Tabs are a mode, and it is off by default. Open Settings → General → Tabbed preview. You can also pick "Tabbed mode" in the "How to open" card on the welcome page.

The setting applies to new windows. Windows that are already open keep their single-document shape — they will not be retro-fitted with a tab strip. Change the setting, then double-click a .md file again and the new window opens with tabs.

Single-file mode is untouched: double-click a document, get its own window, press Esc to close it, exactly as before. Both modes share the same reading, editing and export code — the only difference is how documents open.

Opening files, browser rules

  • Already open → activate it. Double-click a .md in Explorer that mdpeek already has open and it will not spawn a second window — it switches to that tab;
  • Not open → new tab. The sidebar file list, Ctrl+O, drag-and-drop, and md links inside documents all open a tab in the current window unless the target is already in the strip;
  • The "+" at the far right creates a new file, not a new empty tab. The new .md lands directly in the current tab, saving you the "create an empty file, then open it" dance.

One detail that is easy to miss: each tab owns its own page state. Scroll to line 300 in document A, switch to B to answer a message, come back — A is still at line 300. Leave an F2 in-place edit or an F3 split-screen session half finished and it survives the switch. A large document still takes time to render the first time, but later switches do not re-parse it.

Working the tab strip

The interactions follow desktop habits, and the shortcuts match a browser (swap Ctrl for ⌘ on macOS):

What you wantHow
Switch tabsCtrl+Tab / Ctrl+Shift+Tab, cycling
Jump to tab NAlt+1 … Alt+9
Close the current tabCtrl+W / Ctrl+F4 / Esc while reading
Close a specific tabThe × on the tab, or middle-click
ReorderDrag the tab left or right
Close others / to the rightRight-click the tab
Pin a tabRight-click → "Pin tab" — a * appears on its left
Copy file / path / nameRight-click → "Copy" submenu
Open containing folderRight-click → "Show in Explorer" (Finder on macOS)

Pinning is for the document that must not go away: once pinned, ×, middle-click, Ctrl+W, Esc, "close others" and "close to the right" all leave it alone. It also will not be replaced in place — clicking an md link inside a pinned tab opens a new tab instead of swapping the document underneath you. Unpin first if you want to change what it shows.

Closing the last tab does not quit the app; it returns to the welcome page. The welcome page is now an overlay in the main window rather than a tab, and you can summon it any time with right-click on the tab strip → "Open welcome page". If you realise mid-task that you need another document, just open a new tab — no need to close the one in hand.

One sidebar, more room for text

In tabbed mode the sidebar still has the same four tabs — outline, files, history, favorites — but only one sidebar. An early build put one on each side, which squeezed the article between them; it is now a single sidebar that takes space on one side only. Prefer it on the right? Tick "Show sidebar on the right" in settings and the current window follows immediately.

Which sidebar tab is showing is a window-level state: switch to the outline in document A and document B still shows the outline, instead of bouncing back to the file list on every document change. The outline itself still follows each document, with its own heading tree and collapsed state. To give the article the whole window, click the ⛶ in the title bar for content fullscreen — it hides the title bar, tab strip and sidebar, but only for the current tab; switching tabs returns to normal reading.

Close it, reopen it, the tabs are still there

In tabbed mode, launching the exe directly (with no file argument) restores the previous tab list, order, pinned state and active tab. The session is written on change, not on exit, so an unexpected process kill or a power cut usually still leaves your tabs and active document intact.

Restoring does not stupidly re-render everything: at startup only the active tab is materialised, and background tabs stay "registered but not loaded" until you first click them. No matter how many tabs you keep, cold start is not dragged down to "open N large documents". If a file was deleted or its drive is offline, it is skipped silently instead of producing a wall of errors.

Working with the Sublime Text / VS Code plugins

If you use mdpeek's editor plugin for live preview, tabs will not steal the wrong page: when the plugin pushes content, mdpeek activates the matching tab first if it happens to sit in the background, instead of painting the update over the document you are reading. Keep several tabs open while writing and the preview still follows the right file.

A few deliberate limits

  • Off by default, single-document mode unchanged: not everyone wants tabs, so "double-click to read, Esc to leave" is fully preserved;
  • Memory grows with tab count: each tab is a separate WebView, which is the price of "switching does not re-render and edits are not lost". Open a dozen huge documents at once and Task Manager will honestly report it;
  • Files are restored, reading context is not: the tab list, order, pinning and active tab come back; scroll positions, back/forward stacks and content-fullscreen state do not — they belong to "this reading session", not "this piece of work";
  • No tab groups, colours or vertical tabs yet: first make open, switch, close and restore rock solid; more elaborate workflows can follow real feedback.

Three steps: ① update to mdpeek 2.0.1 (installing over 1.0.196 keeps settings and favorites); ② Settings → General, switch on "Tabbed preview"; ③ double-click a few .md files and watch them line up as tabs in one window. Then try Ctrl+Tab, Alt+1 and drag-to-reorder.

Tabs solve "reading several things at once". The other big piece of 2.0 solves "I edited the wrong thing — how do I get back": mdpeek now ships version history and diff. Continue with the next post on built-in version history.