18 ms·
Unfortunately, this is not definitive. Here are a bunch of corrections, off the top of my head: * echo -e is not portable across shells, and even across versi
by JdeBP 7y ago
Unfortunately, this is not definitive. Here are a bunch of corrections, off the top of my head:
* echo -e is not portable across shells, and even across versions of the same shell sometimes. The test output should be generated with printf. https://unix.stackexchange.com/q/65803/5132 https://unix.stackexchange.com/q/65803/5132
* The article erroneously says "If you don't see italicised foo above, then you need to add a custom terminfo." where what it should say is "If vim does not emit this control sequence", or it should have an intermediate example using tput in place of hardwired control sequences. A custom terminfo will not affect the echo/printf command of the raw control sequences at all.
* The sideswipe about "better terminal emulators" mentioning only 3 fashionable ones is not well-founded. In fact, most terminal emulators (from XTerm to Konsole, including even recent VTE-based ones) support italicization. Supporting the boldface/roman/italics triad that has been in Unix document processing for approaching half a century is not a niche or novel thing.
* The xterm-256color entry in terminfo already has ritm= and sitm= capabilities (via xterm-base and ecma+italics). There's no need to make one's own from someone's file on GitHub. https://invisible-island.net/ncurses/terminfo.ti.html#tic-xterm-256color https://invisible-island.net/ncurses/terminfo.ti.html#tic-xt...
* The correct terminal type for tmux in terminfo is tmux or tmux-256color, which again already have ritm and sitm (again via ecma+italics). There is no need for a "new entry called 'tmux'". One should already have been there for roughly 5 years now. https://invisible-island.net/ncurses/terminfo.ti.html#tic-tmux-256color https://invisible-island.net/ncurses/terminfo.ti.html#tic-tm...
- hyperpallium 7y agoI had italics in vim (TERM was xterm-256color), but not in tmux (TERM was screen). Added this to ~/.tmux.conf and it works: set -g default-terminal "xterm-256color" BTW it matters to me when using vim as a markdown viewer (esp for github readme.md).
- JdeBP 7y agoThat is the wrong thing to do. The correct terminal type for tmux is either "tmux" or "tmux-256color". Even "screen" and "screen-256color" are not perfectly correct descriptions of tmux nowadays (italics actually being a case in point); and there is no problem with importing a "tmux-256color" entry into a more-than-half-a-decade-old terminfo database. The database structure lends itself both to copying individual records and to having extra records in one's home directory. You should not be using "xterm-" anything with tmux, or with any terminal or terminal emulator that is not actually XTerm. Indeed, this mis-use is called out right at the top of the tmux FAQ. * http://jdebp.uk./Softwares/nosh/guide/commands/TERM.xml#MIS-CONFIGURATION http://jdebp.uk./Softwares/nosh/guide/commands/TERM.xml#MIS-... * https://invisible-island.net/xterm/xterm.faq.html#other_versions https://invisible-island.net/xterm/xterm.faq.html#other_vers... * https://github.com/tmux/tmux/wiki/FAQ https://github.com/tmux/tmux/wiki/FAQ