Search code examples
windowsvimxtermansi-escape

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.


Solution

  • 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}.