I would like to have an if-else loop in .screenrc for the following codes so that it runs if my terminal supports 256 colors. Otherwise, it does not start.
attrcolor b ".I" # tell screen how to set colors. AB = background, AF=foreground termcapinfo xterm "Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm" termcapinfo xterm-color "Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm"
How can you create an if-else loop in .screenrc?
This should already be installed by the terminfo database file. In my case, my default terminal is xterm. It uses 8 colors, which are reflected in vi, using
: install termcap
t_Co, 8. , gnome-256color, 256 , vi t_Co 256. , .vimrc.
, - , bash:
#!/bin/bash if [ "$TERM" = "xterm-256color" ]; then # do stuff for 256 else if [ "$TERM" = "xterm" ]; then # do stuff for 16 else # do something else entirely fi fi
My pseudo code attempt for .screenrc
[ -e t_Co(256) ] . ColorFile
Same thing in english
If 256 color support, then source ColorFile.
Source: https://habr.com/ru/post/1709416/More articles:Is there any way to render HTML code with great style in isolation from the rest of the site’s styles? - htmlHow to return all values from a stored procedure? - sqlStrongly typed Adapter.Update dataset without inserting a string - c #Is there a metalanguage available for Java that allows you to access complex object hierarchies? - javaInteraction with Applescript and iCal - applescriptОптимизация приложения Flex - Где найти мои узкие места - optimizationGet parent element of IStructuredSelection (eclipse-rcp)? - javaHow to add my program to PATH in Windows.NET? - installerEmail notifications. In a domain object or service? - domain-driven-designASP.NET Dynamic Data Change text field in drop-down list and fill with some data - drop-down-menuAll Articles