How can I check if my terminal supports DEC mode 2031?

Is there a command I could run to check if the terminal I am using supports DEC mode 2031?
What’s DEC mode 2031? How can I found more information about it?

Context: terminal supports DEC mode 2031 is one requirement to use Nvim 0.11 builtin UI (TUI) feature that automatically sets ‘background’ based on your OS theme (dark/light).

It appears that you would want to try something like:

echo -ne '\e[?2031h'
echo -ne '\e[?2031$p'; cat

However, for me this doesn’t produce any output (so I suspect my terminal doesn’t have this capability).

See also the answers on this post.

Are you using what terminal?

In rio this doesn’t produce any output. In ghost there’s a output:

echo -ne '\e[?2031h'
echo -ne '\e[?2031$p'; cat
^[[?2031;1$y

I am using NVIM v0.11.0-dev-1569+g92d3bf101d but the new feature that automatically sets ‘background’ is not working, I am not sure if it was included in the version I am using since version 0.11 wasn’t released

I use alacritty. From my understanding of the linked SO thread, I think the response you get on ghost should mean that this feature is supported on that terminal. However, if the automatic background setting still doesn’t work then I’m unfortunately out of my depth. I would suggest to ask at the neovim github discussions forum, if you have a github account.

1 Like