Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where xterm Escape sequences like "Esc | 112 m" are defined?

While implementing xterm-256-colors in ConEmu I have discovered some unknown for me Escape sequences (used by Vim) like

Esc | 7 m
Esc | 15 m
Esc | 112 m

From Vim sources I realize that these codes are used for changing bold or inverse attributes, but I can't find any docs about them.

Are there any specifications for Esc | N m sequences? They were not mentioned here.

like image 456
Maximus Avatar asked Jan 20 '13 20:01

Maximus


People also ask

What is ESC M?

ESC M. moves cursor one line up, scrolling if needed. ESC 7. save cursor position (DEC)

What is ESC 0m?

ESC = Set numeric keypad mode (default) ESC > Turn off all character attributes ESC [m -or- ESC [0m. Turn underline mode on.

What is a terminal control sequence?

A Terminal Control Code, AKA terminal escape sequence, AKA terminal control sequecence, is an in-band sequence of bytes that may be interpreted by a character imaging device such as a terminal.

Do ANSI escape sequences work on Windows?

The advantage of using ANSI escape codes is that, today, these are available on most operating systems, including Windows, and you don't need to install third party libraries. These are well suited for simple command line applications. If you need to do complex text graphics check the ncurses library.


1 Answers

I believe these are internal vim codes for internal processing only: first set of \033| is labeled

/*
 * GUI pseudo term-cap.
 */

and AFAIR is processed in gui.c or gui_*.c, second set is labeled

/*
 * These codes are valid for the pc video.  The entries that start with ESC |
 * are translated into conio calls in os_msdos.c. Default for MSDOS.
 */

third set is labeled

/*
 * These codes are valid for the Win32 Console .  The entries that start with
 * ESC | are translated into console calls in os_win32.c.  The function keys
 * are also translated in os_win32.c.
 */

(I am talking about builtin_termcaps array). Further mentions: only in update_tcap function, there are no direct references that these are processed by some other function, but it is unlikely that it is something else (not familiar with pseudo-termcap processing code). Except for term.c it is only seen directly (i.e. grep finds \033|) in screen.c (twice) and gui.c (once).

And, by the way, I failed to see this code in output of vim launched in logging screen session using env TERM=xterm vim {args}.

like image 154
ZyX Avatar answered Sep 28 '22 01:09

ZyX