VS Code extension enabling ANSI color styling for text documents https://marketplace.visualstudio.com/items?itemName=iliazeus.vscode-ansi
Find a file
2025-08-12 19:34:29 +05:00
.vscode initial commit 2020-10-13 01:04:41 +07:00
images update readme 2021-01-22 21:56:41 +07:00
src Flip colors if the Inverse flag is set 2025-08-12 19:34:29 +05:00
test Flip colors if the Inverse flag is set 2025-08-12 19:34:29 +05:00
.eslintrc.json update linter config 2020-10-14 01:03:00 +07:00
.gitignore initial commit 2020-10-13 01:04:41 +07:00
.prettierrc initial commit 2020-10-13 01:04:41 +07:00
.vscodeignore initial commit 2020-10-13 01:04:41 +07:00
ansi.language-configuration.json fix extension not being activated by onLanguage event 2024-02-05 14:02:31 +06:00
CHANGELOG.md Flip colors if the Inverse flag is set 2025-08-12 19:34:29 +05:00
LICENSE add license file 2020-10-22 19:10:25 +07:00
package.json Flip colors if the Inverse flag is set 2025-08-12 19:34:29 +05:00
README.md add an FAQ section to README.md 2025-08-12 14:26:16 +05:00
tsconfig.json initial commit 2020-10-13 01:04:41 +07:00
yarn.lock update dependencies 2023-02-27 15:05:22 +06:00

Visual Studio Marketplace GitHub MIT License Open Issues Closed Issues

ANSI Colors

ANSI Color styling for your text editor.

Basic usage

Select the ANSI Text language mode to highlight text marked up with ANSI escapes. Files with the .ans and .ansi extensions will be highlighted by default.

ANSI Text language mode; Dark Plus theme

Run the ANSI Text: Open Preview command for the prettified read-only preview.

ANSI Text preview; Dark Plus theme

Clicking the preview icon in the editor title will open the preview in a new tab. Alt-click to open in the current tab.

Preview icon

The extension fetches the colors from the current theme and aims to look as good as the built-in terminal.

ANSI Text preview; various themes

FAQ

  • How do I enable this extension for files other than .ans and .ansi?

    This can be done using the VS Code "language mode" feature. For example, to enable it for all .log filesd, open a .log file, then do F1 - Change Language Mode - Configure File Association for '.log' - ANSI Text.

  • Can the "preview mode" be opened automatically?

    No, it can't, not with the way the extension is currently designed, at least.

    vscode-ansi uses VSCode's built-in text editors in readonly mode (via TextDocumentContentProvider) for preview display. The only custom editors allowed to open files "by default" (e.g. by double-click) are webview-based custom editors. But building such an editor means reimplementing all the default functionality from scratch - navigation, searching, line wrap, interaction with other extensions (e.g. spell check).

Supported ANSI escape codes

Basic colors and formatting:

Basic formatting

8-bit colors:

8-bit colors

24-bit colors:

24-bit colors