Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add terminal compatbility list to README #54

Merged
merged 1 commit into from Jan 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 24 additions & 0 deletions README.md
Expand Up @@ -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)
Expand Down
48 changes: 48 additions & 0 deletions 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
```