martanne / vis

A vi-like editor based on Plan 9's structural regular expressions
Other
4.19k stars 260 forks source link

[BUG] Syntax Highlighting Incorrect when TERM value is not set to foot in Foot #1175

Closed VehementHam closed 2 months ago

VehementHam commented 2 months ago

Problem

When opening vis from ZSH, Bash, Fish, and Elvish, the syntax highlighting is horribly deformed. Here is a screenshot: image

As you can see, the syntax highlighting on the right (ZSH) is wrong. The left is Nushell. Shells that vis functions correctly are include Ash, Ion, and as stated before, Nushell.

Steps to reproduce

No response

vis version (vis -v)

vis 0.8 +curses +lua +acl

Terminal name/version

foot version: 1.16.2 +pgo +ime +graphemes -assertions

$TERM environment variable

xterm

Edit: This issue actually occurs when the TERM value is set to something other than foot.

rnpnr commented 2 months ago

Yes this is expected behaviour. When TERM=xterm curses assumes that the terminal does not support 256 colours. Foot by default supports it. I'm a little confused as to why you are setting TERM=xterm when you are using foot. If you must TERM=xterm-256color should work fine.