Blog
GuideUpdated September 29, 2026 · 10 min read
By the ZoomCap teamPublished August 12, 2026Facts checked September 29, 2026

How to Record a Terminal Session on Mac & Linux (Video or GIF)

Record your terminal on Mac or Linux as text (asciinema, VHS) or real video, turn it into a GIF, and keep it legible on a phone. Commands and decision tables.

By the ZoomCap team.We make ZoomCap, which appears in this article. Prices and features were checked on each vendor's own site on September 29, 2026. Where we could not test a tool ourselves, we say so. How we test

Short answer

The fastest way to a terminal demo people can read: record with ZoomCap's CLI. Run npx zoomcap record on macOS or Linux X11 and it zooms in on your typing automatically, which click-only recorders can't do in a terminal. The video never leaves your computer, the editor is free to try in the browser, and the CLI is $29 once. Bump the font to 18px first.

Pick something else only for docs where readers copy commands out of the player (asciinema, or VHS for scripted GIFs that regenerate in CI), or if you record on Windows.

There are two ways to record a terminal, and most bad terminal demos come from picking the wrong one. This guide covers both, including how to record a terminal session on Mac and Linux, how to record a terminal to a GIF, and which approach fits which destination. Commands for asciinema, VHS and script are from each project's own documentation; ZoomCap commands are from our docs.

Option 1: record the text (asciinema, VHS)

asciinema doesn't record pixels. It records the character stream of your session and replays it in a web player. The files are tiny, the “video” is crisp at any size, and viewers can pause and copy-paste commands straight out of the recording. That last property is hard to beat for documentation. VHS takes the same idea further: you script the entire session in a .tape file and it renders a deterministic GIF or video, which suits demos that regenerate in CI whenever your CLI's output changes.

Use text-based recording when the destination is:

  • Documentation or a README where readers copy commands
  • A tutorial that must stay current (VHS plus CI regenerates it)
  • Anywhere file size matters and a web player is embeddable

The limit: text recorders only see the terminal. If your demo opens a browser, a GUI or a second app, none of that appears.

Option 2: record the pixels (real video)

Text-based recording stops working the moment your demo isn't purely text. A launch video that cuts from terminal to browser. A CLI that opens a UI. A social clip that needs to autoplay as MP4. A homepage hero. A Product Hunt gallery asset. For all of these you need actual video, and that is where the problems start, because raw terminal footage is some of the worst-looking screen recording there is.

How to record a terminal session on Mac

As text

  1. Install asciinema: brew install asciinema.
  2. Start recording: asciinema rec demo.cast. A new shell starts inside the recording.
  3. Run your demo, then type exit or press Ctrl+D to stop.
  4. Replay locally with asciinema play demo.cast, embed the player in your docs, or convert to a GIF (below).

No install at all: macOS ships the BSD script command. script -r session.log records with timing, and script -p session.log plays it back. It is fine for a personal log and awkward to share, which is why asciinema exists.

As video

  • ZoomCap's CLI: run npx zoomcap record from any terminal. On macOS 15+ it records at 60fps by default with system audio and mic through ScreenCaptureKit; older macOS versions fall back to ffmpeg and record video only. A ● REC item sits in the menu bar while it runs, and typing bursts become zooms without any editing.
  • Shift+Command+5, choose “Record Selected Portion”, and draw around the terminal window. Free and built in; no zoom, no editing. Our Mac screen recording guide covers every option.
  • OBS Studio: free, with a window capture source for just the terminal. You add zooms in an editor afterwards.

How to record a terminal session on Linux

As text

  1. Install asciinema from your package manager (for example sudo apt install asciinema) or from asciinema.org.
  2. asciinema rec demo.cast, run the demo, then exit.
  3. Or use util-linux's script --timing=time.log session.log and replay with scriptreplay --timing=time.log session.log.

As video

  • ZoomCap's CLI: npx zoomcap record records X11 sessions and tracks clicks and typing for automatic zoom. It records video only: no Wayland and no system audio yet, so record a voiceover separately if you need one.
  • Your desktop's built-in recorder: GNOME, for example, has screen recording in its screenshot tool. Fine for a quick clip, no editing.
  • ffmpeg on X11: ffmpeg -f x11grab -framerate 30 -i :0.0 terminal.mp4 records the display with no UI at all. Add -video_size and an offset to capture just a region.
  • OBS: free and reliable on X11 and Wayland, with no editor or automatic zoom.

More Linux options, including Wayland-native ones, are in our Linux recorder roundup.

Why raw terminal video fails: the legibility math

Your terminal font is maybe 13px on a 2560px-wide display. X's inline player shows that recording at roughly 500px wide on a phone, so your text is now under 3 pixels tall. Nobody is reading that. This is the main reason terminal demos get scrolled past: not the content, the size.

You have three fixes, in ascending order of quality:

  1. Record a smaller region. Capture a 1280px window, not the full display. Better, but still static.
  2. Bump the font before recording. 18–20px minimum for anything viewed on a phone. Do this regardless of what else you do.
  3. Zoom to the action. Show the full frame for context, then move in close on the command being typed and its output. This is what makes a demo watchable rather than merely legible.

If the result still looks soft, our list of reasons screen recordings look blurry covers scaling and compression.

The catch: click-based auto-zoom can't see a terminal

Here is the detail most write-ups of auto-zoom screen recorders skip: almost all of them key their zooms off mouse clicks. A terminal session is keyboard-driven. There is little to click, so there is little to zoom to, and the feature does nothing on exactly the content that needs it most.

Why ZoomCap for terminal demos

This is why ZoomCap also triggers on typing: it detects a burst of keystrokes (timing only, never which keys), closes in on where you last clicked, holds while you work, and releases when you pause. It does not follow the text caret, so click once into the terminal pane before you type and the zoom lands on the right place. ZoomCap is itself a CLI, which suits terminal demos: npx zoomcap record and you are recording.

We make ZoomCap, so weigh this accordingly. The CLI is part of the paid plans: $29 once or $12.49 a month. The free plan gives you the browser recorder and editor with 2 watermarked exports a month, but the browser recorder only sees clicks inside its own tab, so terminal recordings made there need zooms placed by hand. There is no Windows CLI yet, no motion blur, and speed changes apply to the whole video. Recordings are edited and encoded on your computer and never uploaded to us; the data flow is on our security page, and paid plans have a 14-day refund if it doesn't work for you.

How to record a terminal to a GIF

A GIF is still the default for READMEs and issue threads because it autoplays everywhere. Three ways to get one, from most to least deterministic:

1. VHS: script it, get a GIF

Install with brew install vhs (it needs ttyd and ffmpeg; other installs are on the VHS README). Then write demo.tape:

Output demo.gif
Set FontSize 28
Set Width 1200
Set Height 600
Type "npx mytool --help"
Sleep 500ms
Enter
Sleep 3s

Run vhs demo.tape and you get demo.gif. Change the Output line to .mp4 or .webm for video. vhs record > demo.tape writes a tape from a session you type live, which you can then tidy up.

2. asciinema plus agg

Record with asciinema rec demo.cast, then convert with asciinema's GIF generator: agg demo.cast demo.gif. You can set the font size and theme on the command line, which keeps text legible at README widths.

3. Record video, then convert

When the demo includes anything other than the terminal, record video and export a GIF. ZoomCap exports GIF directly from the editor, and our free MP4 to GIF converter runs in the browser. With ffmpeg, generate a palette first so the text doesn't band:

ffmpeg -i demo.mp4 -vf "fps=12,scale=800:-1:flags=lanczos,palettegen" palette.png
ffmpeg -i demo.mp4 -i palette.png -lavfi "fps=12,scale=800:-1:flags=lanczos[x];[x][1:v]paletteuse" demo.gif

Keep terminal GIFs to about 10–15fps and 800px wide; text doesn't need more frames, and size balloons fast. GitHub's limits and embed markdown are in adding a demo GIF to your README, and palette settings in more depth in turning a screen recording into a GIF.

A recordable-terminal checklist

  • Font at 18px or more, and a high-contrast theme (not a 40%-opacity translucent one)
  • A short prompt: ~/project $, not a three-line powerline
  • Clean history, and clear before starting
  • Window at roughly 16:9 proportions so the crop doesn't waste space
  • Hide tokens and hostnames: set a throwaway prompt and unset secrets from your environment
  • Type at natural speed; trim the dead air in the edit
  • Rehearse once; the second take is almost always tighter

The decision table

ToolRecordsOutputPrice (checked Sep 2026)PlatformsMain tradeoff
ZoomCap CLIPixels plus click and typing timingMP4 up to 4K, GIF$29 once or $12.49/mo; free browser planmacOS and Linux (X11)Zooms on typing automatically; no Windows CLI, video-only on Linux
asciinemaText stream, live.cast (web player); GIF via aggFree, open sourcemacOS, LinuxCopyable and tiny, but terminal only
VHSScripted text sessionGIF, MP4, WebMFree, open sourcemacOS, Linux, WindowsDeterministic and CI-friendly, but you script every keystroke
scriptText stream, liveLog plus timing fileBuilt inmacOS, LinuxNothing to install, hard to share
Shift+Command+5PixelsMOVBuilt inmacOSFree, but no zoom or editing
OBS StudioPixelsMKV, MP4 and moreFree, open sourceWindows, macOS 12+, LinuxThe best free capture and streaming tool; no editor or automatic zoom

And by destination:

DestinationUseWhy
Docs / README referenceasciinemaCopy-paste, tiny files, always crisp
Auto-regenerating CLI docsVHSScripted, deterministic, CI-friendly
Launch video / homepageZoomCap (real video with typing zoom)Mixed terminal and UI, needs MP4, needs to look finished
Social clipsZoomCap (real video with typing zoom)Autoplay MP4, phone-sized player, legibility critical
README hero GIFEitherVHS for pure CLI; video to GIF when a UI is involved

The workflow we use for real video

  1. Open two terminals: one for the demo, one for ZoomCap. Run npx zoomcap doctor once to check permissions, and npx zoomcap displays if you have more than one screen.
  2. npx zoomcap record in the second terminal. On macOS 15+ that is a 60fps capture with system audio and mic.
  3. Click into the demo terminal and run the demo. Typing bursts and clicks become zooms automatically.
  4. Stop: on macOS, ⌃⌥S works from any app; otherwise switch back to the ZoomCap terminal and press q.
  5. The editor opens in the browser: re-aim or delete any zoom, trim the fumbles, cut the dead air, add a background and captions. Speed-up applies to the whole video (1.5× or 2×), so cut long waits rather than speeding up one section.
  6. Export MP4 from 720p up to 4K, or GIF for a README. Encoding runs locally; nothing is uploaded. MP4/H.264 is the right compatibility master; add a WebM sibling only when you control the player. Settings by channel are in MP4 vs MOV vs WebM.

When the job is docs rather than a demo, use asciinema. The best terminal-recording setup is both approaches, each where it belongs. For more on recording from the command line, see command-line screen recorders with auto zoom.

Frequently asked questions

How do I record a terminal session on a Mac?

For a video, run npx zoomcap record: ZoomCap's CLI records the screen and zooms in on your typing automatically. Shift+Command+5 also records the terminal window, without zoom. For a text recording, run asciinema rec demo.cast (install with brew install asciinema), or use the built-in script -r session.log and replay it with script -p. Bump the terminal font to 18px or more first.

How do I record a terminal session on Linux?

For text, use asciinema rec demo.cast, or util-linux's script --timing=time.log session.log and replay it with scriptreplay. For video, use OBS, your desktop's built-in screen recorder, or ffmpeg's x11grab on X11. ZoomCap's CLI records Linux X11 sessions with automatic zoom on clicks and typing, video only (no Wayland or system audio yet).

How do I record the terminal to a GIF?

The simplest route is VHS: write a .tape file with Output demo.gif and run vhs demo.tape. If you already have an asciinema recording, convert it with agg demo.cast demo.gif. For a pixel recording, export a GIF from your editor or convert the MP4 with ffmpeg using a generated palette, keeping it to about 10-15fps and 800px wide.

asciinema or VHS: which should I use?

Use asciinema to capture a real session you type live, especially for docs where viewers copy commands from the player. Use VHS when you want a scripted, repeatable recording that regenerates in CI and outputs a GIF, MP4 or WebM directly. Neither can show a browser or a GUI, so switch to real video when the demo leaves the terminal.

Does ZoomCap see what I type in the terminal?

No. For typing zoom, the CLI records only the timing of key presses, never which keys you pressed, and the video is recorded, edited and encoded on your computer without being uploaded to us. The data flow is on our security page. The CLI is part of the paid plans ($29 once or $12.49 a month).

Record your terminal demo

Try the editor free in your browser with nothing to install, then run npx zoomcap record for automatic zoom on your typing. The CLI, unlimited exports and no watermark are $29 once on the pricing page.

What ZoomCap costs

Checked September 29, 2026

Free

$0

Browser recorder and editor, 2 exports a month with a small watermark.

Lifetime

$29

One payment. Unlimited exports, no watermark, the CLI, 4K export.

Pro

$12.49/mo

Same features as Lifetime, cancel anytime.

Over three years, ZoomCap Lifetime costs $29 and Screen Studio's yearly plan costs $324 ($108 a year), a difference of $295. Of the 21 recorders we price-checked, ZoomCap is the only one at $29 one-time that records in the browser with nothing to install, zooms on both clicks and typing, and runs from the terminal on macOS and Linux. Start free, and pay once only if it earns it.

14-day refund window on paid plans · refund terms · pricing page

Is ZoomCap safe?

Your recordings
Recorded, edited and encoded on your own computer. Video never goes to our servers: the CLI hands the file to the editor over localhost. See the data flow
Keystrokes
Only the timing of key presses, to drive typing zoom. Which keys you pressed is never captured or stored.
Account and payments
Sign-in and licence records are held by Google Firebase. Payments are processed by Dodo Payments, so we never see your card. Privacy policy
Refunds and support
If ZoomCap doesn't work for you and we can't fix it, email us within 14 days for a refund. Commercial use is allowed on every plan. Contact us · About ZoomCap

What ZoomCap doesn't do

  • No Windows CLI yet. On Windows, use the free browser recorder in Chrome or Edge.
  • No motion blur.
  • Speed changes apply to the whole video (1×, 1.5× or 2×), not per section.
  • Automatic zoom needs the CLI's click data. On browser recordings and imported videos you place zooms by hand.
  • On Linux the CLI records video only (X11 sessions, no Wayland, no system audio yet).
  • No hosted share links, comments or viewer analytics. You export a file and share it yourself.