diff --git a/README.md b/README.md index 6379d87..9e56fb0 100644 --- a/README.md +++ b/README.md @@ -273,6 +273,30 @@ termenv.EnableMouseAllMotion() termenv.DisableMouseAllMotion() ``` +## Compatibility + +| Terminal | Alt Screen | Change Cursor Color | Change Default Foreground Color | Change Default Background Color | Query Color Scheme | Query Cursor Position | Set Window Title | +| ---------------- | :--------: | :-----------------: | :-----------------------------: | :-----------------------------: | :----------------: | :-------------------: | :--------------: | +| alacritty | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | +| Gnome Terminal | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | +| kitty | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | +| konsole | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | +| rxvt | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | +| wezterm | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | +| xterm | ✅ | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ | +| Linux Console | ✅ | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ | +| Apple Terminal | ✅ | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ | +| iTerm | ✅ | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ | +| Power Shell | ✅ | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ | +| Windows Terminal | ✅ | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ | + +You can help improve this list! Check out [how to](ansi_compat.md) and open an issue or pull request. + +### Color Support + +- 24-bit (RGB): alacritty, Gnome Terminal, kitty, konsole, wezterm, Windows Terminal +- 8-bit (256): rxvt, xterm, Apple Terminal + ## Color Chart ![ANSI color chart](https://github.com/muesli/termenv/raw/master/examples/color-chart/color-chart.png) diff --git a/ansi_compat.md b/ansi_compat.md new file mode 100644 index 0000000..67ef4e4 --- /dev/null +++ b/ansi_compat.md @@ -0,0 +1,48 @@ +## Change Foreground Color + +This command should enable a blue foreground color: + +```bash +echo -ne "\033]10;#0000ff\007" +``` + +## Change Background Color + +This command should enable a green background color: + +```bash +echo -ne "\033]11;#00ff00\007" +``` + +## Change Cursor Color + +This command should enable a red cursor color: + +```bash +echo -ne "\033]12;#ff0000\007" +``` + +## Query Color Scheme + +These two commands should print out the currently active color scheme: + +```bash +echo -ne "\033]10;?\033\\" +echo -ne "\033]11;?\033\\" +``` + +## Query Cursor Position + +This command should print out the current cursor position: + +```bash +echo -ne "\033[6n" +``` + +## Set Window Title + +This command should set the window title to "Test": + +```bash +echo -ne "\033]2;Test\007" && sleep 10 +```