Skip to content

Commit

Permalink
Add terminal compatbility list to README
Browse files Browse the repository at this point in the history
  • Loading branch information
muesli committed Jan 31, 2022
1 parent 9d49376 commit 2d67de7
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
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
```

0 comments on commit 2d67de7

Please sign in to comment.