Compress Preview
Preview the contents of ZIP-, TAR-, GZIP-, 7z-, XZ-, BZIP2-, and Zstandard-based archive files directly inside VS Code.
Compress Preview replaces the usual binary file experience with a focused archive view so you can inspect entries, open text files, and extract files without leaving the editor.
What It Does
- Opens supported archives in a custom preview view.
- Lists files and folders inside the archive.
- Lets you open text-based files directly in VS Code.
- Opens common binary entries through temporary extracted preview files.
- Lets you extract one file, selected entries, or the full archive.
- When Extract all would overwrite an existing folder, you can merge conflicting files, replace the folder after a warning, or choose another location.
- Handles large archives with loading and partial-result states instead of hanging forever.
Screenshots

How To Use
- Open a supported archive file in VS Code.
- Browse the archive contents in the preview. Arrow keys move the focused row; Enter opens a file or toggles a folder; Space selects.
- Open a file from the tree to preview it in VS Code.
- Use Extract, Extract selected, or Extract all when you want files written to disk.
.zip, .jar, .apk, .vsix, .xpi, .whl, .war, .ear, .tar, .tgz, .tar.gz, .gz, .tbz2, .tbz, .tar.bz2, .txz, .tar.xz, .tzst, .tar.zst, .bz2, .xz, .zst, .7z, .epub,
.docx, .pptx, .xlsx, .odt, .ods, .odp, .aar, .crx, .nupkg, .cbz, .kmz, .ipa, .appx, .msix
What Opens In The Editor
Text-like files open directly in VS Code as read-only virtual documents, including common formats such as:
.txt, .json, .md, .xml, .html, .css, .js, .ts, .yml, .yaml, .csv, .log
Additional extensions in compress-preview.textExtensions are classified as text in both the archive tree and the editor, so a .toml file is not shown as Binary.
Common binary files open through a temporary extracted preview file so they can use VS Code's normal file handling. GZIP, BZIP2, XZ, and Zstandard archives expose a single decompressed file entry in the preview.
Settings
Open Settings and search for Compress Preview, or edit settings.json:
| Setting |
Default |
Description |
compress-preview.listTimeoutMs |
10000 |
Max time (ms) to spend listing entries before showing partial results. |
compress-preview.watchArchiveFile |
true |
Reload the preview when the archive file changes on disk. |
compress-preview.tempPreviewMaxAgeDays |
7 |
Days to keep cached binary previews under the OS temp folder before pruning. |
compress-preview.textExtensions |
[] |
Additional extensions to treat as text (for example toml, lock) so entries open in the text preview provider. |
compress-preview.maxTextPreviewBytes |
2097152 |
Max decompressed size for text previews. Larger files prompt to extract or open once. Set to 0 to disable. |
Notes
- The preview is read-only.
- Binary previews are extracted to a temporary OS-specific cache path under
compress-preview/ before opening.
- Cached binary previews reuse the same archive-entry path and are pruned after the configured number of days without use.
- Very large archives may show a partial list first. Retry uses a longer timeout and reports how many entries were already loaded. The file list stays virtualized so long archives do not paint every row at once.
- Text previews stop at
compress-preview.maxTextPreviewBytes (2 MB by default) so a huge log cannot exhaust memory. You can extract the file or open it once anyway.
- Folder entries are shown in the archive view but cannot be opened as files.
- Password-protected 7z archives are not supported.
Testing
npm test runs unit and fixture-backed integration tests.
npm run test:e2e bundles the extension and runs all end-to-end tests via Vitest: Playwright webview layout checks (e2e-browser) and VS Code extension-host smoke tests (e2e-extension-host). Webview JSDOM integration tests run with the unit project (src/tests/webview.harness.test.ts).
npm run test:webview:browser runs only the Playwright webview suite (alias for vitest run --project e2e-browser).
Install
Install from the VS Code Marketplace, or install a generated .vsix package manually.
Feedback
Issues and feature requests: https://github.com/bircni/compress-preview/issues
License
MIT