ansi-escape

What does `\x1b(B` do?

自闭症网瘾萝莉.ら 提交于 2019-12-08 12:59:39
问题 I'm a Blessed user, and recently, when I tried to find out the contents of the term.bold() function, I got this output: \x1b[1m\x1b(B\x1b[m I understand what \x1b[1m and \x1b[m do, but what does \x1b(B do? I tried printing it, but it doesn't seem to do anything at all. Thanks in advance! 回答1: The control sequence \x1b(B selects the default character set ASCII. See XTerm Control Sequences: ESC ( C Designate G0 Character Set (ISO 2022, VT100). Final character C for designating 94-character sets

Why does shell mode display some rubbish code?

≡放荡痞女 提交于 2019-12-08 03:36:52
问题 When I use bower in M-x shell , as you can see in the picture, some rubbish code is displayed. However M-x ansi-term works well What could be the problem ? Is it possible to make shell mode display properly ? 回答1: Those symbols are ANSI escape sequences that the terminal emulator uses for visual effects like changing the color of text. shell-mode apparently doesn't know how to display these codes by default. What you want may be Term Mode: Some programs (such as Emacs itself) need to control

Ruby popen3 and ANSI colour

有些话、适合烂在心里 提交于 2019-12-07 02:54:57
问题 I am attempting to get watchr running tests automatically as files change, and got most of what I need working except for the fact that all ANSI colours from RSpec are being disregarded. The offending code is as follows: stdin, stdout, stderr = Open3.popen3(cmd) stdout.each_line do |line| last_output = line puts line end When cmd is equal to something like rspec spec/**/*.rb then the above code runs RSpec fine except that all output is in monochrome. I've looked at using Kernel.system instead

Parsing ANSI escape codes?

元气小坏坏 提交于 2019-12-06 06:13:34
问题 I'm building a telnet app in C# (for scripting door games on oldschool BBS systems e.g. Wildcat) and can't seem to build a working parser for ANSI escape codes (e.g. cursor movement, colorizing, etc) - almost all systems I've tested send undefined sequences which defy any "standards". There also seem to be very few resources on the matter, Wikipedia has the most in-depth list I've found so far but even they say it's incomplete - and most other sites I've encountered just copy/pasted Wikipedia

Converting ANSI escape sequences to HTML using PHP

我是研究僧i 提交于 2019-12-05 23:57:53
问题 This is a similar question to this one. I would like to convert ANSI escape sequences, especially for color, into HTML. However, I would like to accomplish this using PHP. Are there any libraries or example code out there that do this? If not, anything that can get me part way to a custom solution? 回答1: I don't know of any such library in PHP. But if you have a consistent input with limited colors, you can accomplish it using a simple str_replace() : $dictionary = array( 'ESC[01;34' => '<span

Ruby popen3 and ANSI colour

随声附和 提交于 2019-12-05 06:45:58
I am attempting to get watchr running tests automatically as files change, and got most of what I need working except for the fact that all ANSI colours from RSpec are being disregarded. The offending code is as follows: stdin, stdout, stderr = Open3.popen3(cmd) stdout.each_line do |line| last_output = line puts line end When cmd is equal to something like rspec spec/**/*.rb then the above code runs RSpec fine except that all output is in monochrome. I've looked at using Kernel.system instead, however system does not return the output which I need to determine if a test failed / succeeded. How

Windows 10 console VT-100 escape sequences

送分小仙女□ 提交于 2019-12-05 03:21:38
问题 I'm playing around with the new (limited) support for VT-100 escape sequences within the Windows 10 console. The supported sequences are documented at https://msdn.microsoft.com/en-us/library/windows/desktop/mt638032(v=vs.85).aspx. I'm using batch files to test out the features, and I am able to get almost all of the documented features to work. But I am having trouble with the "Viewport Positioning" sequences (scroll up/down) - In my hands they are totally disfunctional (no effect) ESC[<n>S

How is Esc,Alt,Ctrl and arrow keys encoded in ssh/shell

非 Y 不嫁゛ 提交于 2019-12-04 19:21:23
I am making a SSH client for a special device which does not have a all keys on it's keyboard, my question is how is the Esc,Alt,Ctrl and arrow keys encoded in the string sent to the shell? is it just '\033'? I know how the Enter key behaves, it gives an ^M, from here But when i press Ctrl + v and then Ctrl nothing appears, when i press Ctrl + v and then Ctrl + c in the teminal i get: ^C , so is Ctrl just ^ ? But what about alt Further more i found: left ^[[D right ^[[C up ^[[A down ^[[B can i just write these commands as command below, to libssh: rc = libssh2_channel_write(self.channel,

Converting ANSI escape sequences to HTML using PHP

不打扰是莪最后的温柔 提交于 2019-12-04 05:12:11
This is a similar question to this one . I would like to convert ANSI escape sequences, especially for color, into HTML. However, I would like to accomplish this using PHP. Are there any libraries or example code out there that do this? If not, anything that can get me part way to a custom solution? I don't know of any such library in PHP. But if you have a consistent input with limited colors, you can accomplish it using a simple str_replace() : $dictionary = array( 'ESC[01;34' => '<span style="color:blue">', 'ESC[01;31' => '<span style="color:red">', 'ESC[00m' => '</span>' , ); $htmlString =

Can Terminal.app be made to respect ANSI escape codes?

限于喜欢 提交于 2019-12-03 06:47:48
问题 I notice that with the TERM environment variable set to either xterm or xterm-256color that Mac OS X’s Terminal.app utility respects most ANSI escape codes, as least when those escape codes pertain to changing text color. For example: echo -e "\033[0;31mERROR:\033[0m It worked" Produces: However, I’m more interested in the cursor location manipulation functionality afforded by ANSI escape codes. Unfortunately, that type of code doesn’t seem to work too well in Terminal.app, from what I’ve