codeshot.io

How to take a terminal screenshot that looks professional

Capture a terminal window on macOS, Windows and Linux, clean up the prompt and output, and turn commands into sharp, readable images.

SharingBy the Codeshot team6 min read

Quick answer: To screenshot a terminal, use your operating system's window capture (⌘ Shift 4 then Space on macOS, Alt + Print Screen on Windows and most Linux desktops). For an image you will publish, prepare the terminal first — short prompt, cleared screen, trimmed output, no secrets — or paste the command and output into a terminal screenshot generator, which renders a clean, consistent window without your desktop, username or notifications in the shot.

Terminal screenshots are everywhere in developer content: install steps in a README, a command in a tutorial, the output of a deploy in a launch post. They are also some of the most cluttered images on the web — tiny text, a prompt full of usernames and Git branches, half a progress bar, and a desktop wallpaper peeking around the edges.

This guide covers both halves of the job: how to capture a terminal on every major operating system, and how to make the result readable and safe to share.

How to screenshot a terminal window on each operating system

Every operating system can capture a single window, which is cleaner than capturing the whole screen.

System Capture one window Capture a selected area
macOS ⌘ Shift 4, then press Space and click the window ⌘ Shift 4, then drag
Windows 10 / 11 Alt + Print Screen (copies the active window) Windows + Shift + S (Snipping Tool)
Linux (GNOME 42+) Alt + Print Screen Print Screen opens the screenshot tool
Linux (KDE Plasma) Meta + Print Screen (Spectacle) Meta + Shift + Print Screen

A few platform details worth knowing:

  • macOS adds a drop shadow to window captures. Hold Option while clicking the window to capture it without the shadow, or press ⌘ Shift 5 to open the screenshot toolbar with more options.
  • Windows' Alt + Print Screen copies to the clipboard rather than saving a file. Paste it into an editor, or use Windows + Shift + S and choose window mode.
  • On Linux, shortcuts vary by desktop environment and distribution; check your keyboard settings if the defaults above do not match.

Native screenshots are perfect for a quick question in chat. For anything you publish — documentation, a tutorial, a social post — they have real drawbacks: the window size and font size are whatever you happened to have, the image captures exactly what is on screen (including the things you forgot to hide), and every screenshot in a series looks slightly different.

Prepare the terminal before you capture

Whichever capture method you use, five minutes of preparation makes a bigger difference than any editing afterwards.

Use a short, neutral prompt

Elaborate prompts with usernames, hostnames, full paths, Git status and the time push your command off to the right and leak information about your machine. Switch to a minimal prompt for the capture:

# bash
export PS1='$ '

# zsh
export PROMPT='$ '

# fish
function fish_prompt; echo '$ '; end

These only affect the current session, so your normal prompt returns when you open a new terminal.

Start from a clean screen

Run clear (or press Ctrl + L) so only the commands you want appear. If you need to show several steps, run them one after another in the fresh session rather than scrolling back through your history.

Make the text big and the window narrow

Increase the font size (⌘ + or Ctrl + Shift + = in most terminals) until the text would be comfortable to read on a phone. Keep the window around 80 columns wide: wide windows produce wide, short images that become unreadable when a platform scales them down.

Trim noisy output

Package managers and build tools print a lot. Many have flags that keep the output short:

npm install --silent
pip install -q requests
cargo build --quiet
docker build -q .

If the output is the point, show the lines that prove the command worked — the "Ready on http://localhost:3000" line, the test summary, the version number — rather than every line it printed.

Decide about color

Color helps readers separate commands from output and errors from success. But some tools print color codes that look broken when the output is copied elsewhere. Many command-line tools respect the NO_COLOR environment variable if you need plain output, and most accept a --no-color flag.

Remove secrets and personal details

Terminal output is one of the most common sources of leaked credentials. Before capturing, check for:

  • Tokens or passwords passed as flags, such as curl -H "Authorization: Bearer …".
  • The output of env, printenv or export commands.
  • Cloud CLI output that shows account IDs or temporary credentials.
  • Your username and machine name in the prompt or in file paths like /Users/yourname/….
  • Internal hostnames, IP addresses and production cluster names.

Replace real values with obvious placeholders before you take the image. A variable such as $API_KEY is the cleanest option because it is both safe and realistic. Our guide on how to redact secrets in screenshots covers this in depth.

Use a terminal screenshot generator for publishable images

A generator takes the text of your command and output and renders it inside a consistent terminal window. Compared with a native screenshot, you get:

  • Consistency — every image in a tutorial uses the same window, theme, font and size.
  • Privacy by default — only the text you paste appears; no desktop, dock, notifications or other windows.
  • Easy edits — fix a typo, shorten an output line or swap a token for a placeholder without re-running the command.
  • Sharper output — export at 2× resolution, so text stays crisp on high-density screens and after social platforms recompress the image.

The Codeshot terminal screenshot generator works this way: paste a command and its output, choose a theme, font and background, and export a PNG or SVG. Rendering happens in your browser, so nothing you paste is uploaded. For a sequence of commands — install, build, run — the terminal session tool highlights every prompt and softens the output so the steps read in order.

Screenshot, recording or text?

A static image is not always the right format.

You want to show Best format
A single command and its result Screenshot image plus the command as text
A multi-step setup Text code block, optionally with one summary image
An interactive tool, animation or progress Terminal recording (asciinema or a GIF)
A command people will copy Always a text code block

asciinema records a terminal session as text, so viewers can pause it and even copy commands from the player. VHS by Charm generates GIFs and videos from a small script file, which makes recordings reproducible — you can regenerate them after every release.

Whatever you choose, readers who want to run your commands need them as text. In a README or tutorial, put the copyable code block next to the image; on social media, include the command in the post or the alt text.

A checklist for terminal screenshots

  1. Short prompt, cleared screen, large font, window about 80 columns wide.
  2. Only the commands and output that matter; long output trimmed.
  3. No tokens, usernames, hostnames or internal URLs.
  4. Consistent window style across every image in the same document.
  5. Exported at 2× resolution as PNG.
  6. The commands are also available as copyable text.

Frequently asked questions

How do I screenshot only the terminal window on a Mac?

Press ⌘ Shift 4, then press the Space bar. The pointer turns into a camera; click the terminal window to capture just that window. Hold Option as you click to leave out the drop shadow.

How do I take a screenshot of the terminal on Windows?

Click the terminal window to make it active and press Alt + Print Screen to copy it to the clipboard, or press Windows + Shift + S to open the Snipping Tool and choose window or rectangle mode.

Can I take a terminal screenshot without showing my username?

Yes. Set a minimal prompt for the session (for example export PS1='$ ' in bash), avoid commands that print your home directory, or paste the command and output into a terminal screenshot generator, which only shows the text you provide.

What is the best format for terminal screenshots?

PNG. It is lossless, so text stays sharp, and every platform accepts it. Avoid JPEG for text because its compression blurs letter edges. Use SVG only on web pages you control.

Is a terminal screenshot generator free?

Codeshot's terminal screenshot generator is free, requires no account, adds no watermark and runs entirely in your browser.

Related guides