Sample Header Ad - 728x90

terminal-emulator settings controlling the rendering of bold typeface

-1 votes
2 answers
365 views
The effect of bold typeface (ANSI: CSI 1 m) seems to depend on the terminal emulator. For example, running the following script on different terminal emulators #!/bin/sh echo "TERM = $TERM" for mode in 0 2 1 '1;2'; do printf '\033[%s;38;5;%dm\033[48;5;%dm%s\033[0m\n' "$mode" 0 15 "testing ($mode)" done gives the following output enter image description here Of the terminal emulators tested, only xterm properly renders bold text (mode=1). The other terminal emulators seem to select a brighter color for bold typeface (generally also combining this with a bold typeface). Oddly, st produces properly colored, bold text when given the parameters 1;2, corresponding to bold;faint. Thinking that perhaps these terminal emulators expect different control sequences for bold typeface, I checked terminfo, but found unanimity $ for term in xterm-256color st-256color rxvt-unicode-256color tmux-256color; do printf "%-24s" "$term"; TERM=$term tput bold | cat -v; echo; done xterm-256color ^[[1m st-256color ^[[1m rxvt-unicode-256color ^[[1m tmux-256color ^[[1m This leads to the question, what terminal-emulator parameters control the effect of bold typeface? How can the shift to brighter color be prevented? Can this be fixed through Xresources or terminfo customization? (As an aside, are there corresponding parameters for vim? It shows similar behavior, which does not necessarily correspond to that of the terminal emulator in which it is run.)
Asked by user001 (3808 rep)
Feb 15, 2022, 02:36 AM
Last activity: Feb 19, 2022, 04:23 AM