ansi-escape

Discovering remote Terminal for Terminal Escape Codes? (DECDHL in this case)

送分小仙女□ 提交于 2020-01-06 16:22:28
问题 I am trying to determine WHAT console I am running in. (Exceptionally hard based on the research I have done so far.) The latest feature that I discovered that would be useful is Double High, Double Wide for a couple of scenarios. The setup is a Kubuntu 15.04 machine with native (lower) and remote access via Terminal.app on OS X 10.10.4. Based on vt100.net Apple is doing the right thing. #!/bin/bash # Cool effect with OS X Terminal.app # Not as much on others (Like Konsole) function embiggen(

Discovering remote Terminal for Terminal Escape Codes? (DECDHL in this case)

本小妞迷上赌 提交于 2020-01-06 16:20:58
问题 I am trying to determine WHAT console I am running in. (Exceptionally hard based on the research I have done so far.) The latest feature that I discovered that would be useful is Double High, Double Wide for a couple of scenarios. The setup is a Kubuntu 15.04 machine with native (lower) and remote access via Terminal.app on OS X 10.10.4. Based on vt100.net Apple is doing the right thing. #!/bin/bash # Cool effect with OS X Terminal.app # Not as much on others (Like Konsole) function embiggen(

ANSI escape sequence save/restore cursor position support

喜你入骨 提交于 2020-01-03 18:15:47
问题 Are there any known terminals which support the ANSI escape sequences for cursor keys up, down, forward and back: CSI n A Cursor Up CSI n B Cursor Down CSI n C Cursor Forward CSI n D Cursor Back but don't support the save-cursor-position and restore-cursor-position escape sequences? CSI s Save Cursor Position CSI u Restore Cursor Position 回答1: A genuine VT100 (or VT220 for that matter) did not recognize these control sequences for save/restore cursor position. They use (as noted in xterm's

tmux man-page search highlighting

别来无恙 提交于 2019-12-29 16:28:08
问题 When I search in, for example, man ls while in a tmux session, the search strings don't appear highlighted - the page jumps down so that the search string is on the top line of the buffer, as expected, but it's not highlighted. Doing the same thing in the same shell while not in a tmux session results in highlighted search strings. I have no idea where to start looking to solve this. Any hints are appreciated. 回答1: Based on Less Colors For Man Pages by Gen2ly , here is my man page and how to

Reading the Device Status Report ANSI escape sequence reply

拟墨画扇 提交于 2019-12-29 07:35:15
问题 I'm trying to retrieve the coordinates of cursor in a VT100 terminal using the following code: void getCursor(int* x, int* y) { printf("\033[6n"); scanf("\033[%d;%dR", x, y); } I'm using the following ANSI escape sequence: Device Status Report - ESC[6n Reports the cursor position to the application as (as though typed at the keyboard) ESC[n;mR, where n is the row and m is the column. The code compiles and the ANSI sequence is sent, but, upon receiving it, the terminal prints the ^[[x;yR

ANSI Coloring in Compilation Mode

情到浓时终转凉″ 提交于 2019-12-28 11:43:14
问题 Have anyone added support for ansi-color in compilation-mode Emacs? If so what property/attribute does the color-writing program have to check for in order to make sure its active terminal supports ANSI-escape coloring. 回答1: There's already a function for applying color to comint buffers. You simply need to enable it on compilation buffers: (require 'ansi-color) (defun colorize-compilation-buffer () (toggle-read-only) (ansi-color-apply-on-region compilation-filter-start (point)) (toggle-read

Is there a way to output ANSI escape sequences using low level output?

元气小坏坏 提交于 2019-12-25 01:35:27
问题 I'm trying to make a graphical engine in console. I don't use any of the GLs, but soon hoping to start. It is written in C and as for now, it is capable of building semi-3D environment in color, but I found, that win cmd supports True color scheme, using ANSI escape sequences. Throughout my research on this topic I've found WriteFile() , on which all the printfs and putcs are based in Win10. But for all goods it does not provide it is still slow. As internal code shows, writefile is

Handle escape sequences with ncurses? Does printf handle escape sequences?

瘦欲@ 提交于 2019-12-24 00:43:06
问题 My program read some text data from network, something like: Hello \033[1;34mworld\033[0m and bla bla bla!!!\n" . When program output this string using prinf, the word "world" is blue. But when I'm using ncurses interface with wprintw or addch, I see the original string with escape sequences. Does it mean that printf handle escape sequences or not? What is the best way handle escape sequences with ncurses? 回答1: No, your terminal handles the escape sequences. The phenomenon you're seeing comes

Meanings of terminal codes \033[E and \033[07, which appear in printf() statements?

陌路散爱 提交于 2019-12-23 04:24:10
问题 In the C implementation for the Game of Life program, as shown here the codes I mentioned appear in the show() function. I can't find any information at all about what 033[E means and as for \033[07 this is usually a color code in linux bash terminal, where with \033[07 m we begin the color coding and with \033[ m we end the predefined color coding. However, according to this website it means "reverse". I'm not sure what that means. I'm more interested though in \033[E code, for which I can

How can I unit/integration test a program's ANSI escape code behavior?

青春壹個敷衍的年華 提交于 2019-12-20 03:08:46
问题 I've started adding some coloring and other functionality (line resets, etc.) to my application and would like to have some unit tests covering the behavior. I know I could just assert that the output contains the appropriate \e[... codes, but that's brittle. For one, it would fail if it were swapped to \033 or otherwise refactored in trivial but not identical ways. More to the point however, testing the sequence of characters doesn't really do what I want. I want to assert or verify that the