Skip to content

Instantly share code, notes, and snippets.

@cjee21
cjee21 / ANSI_escape_sequences.h
Last active February 7, 2024 20:31
ANSI_escape_sequences.h Header file for C/C++ Programing to use Console Virtual Terminal Sequences which are supported in Windows 10 and Linux. ENABLE_VIRTUAL_TERMINAL_PROCESSING flag must be set using SetConsoleMode on Windows 10 before using any of these sequences. This header file can be used and modified freely without any restrictions.
// List of basic Console Virtual Terminal Sequences
// For more info: https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences
#pragma once
// ----------------------------------------------------------------------------
// Operating System Command (OSC) sequences
// ----------------------------------------------------------------------------
#define WIN_TITLE(x) "\x1B]2;" x "\x07" // Set window title to string x
// ----------------------------------------------------------------------------