SublimeANSI
SublimeANSI copied to clipboard
Unable to configure properly SublimeANSI for 'tput reset' output
Hello !
On my machine tput reset
ouputs the string \033(B\033[m
.
I've been trying to change the configuration in the ansi.sublime-settings so that the ANSI_FG white scope match it but it doesn't seems to be working... here what I tryed:
{"scope": "white", "code": "(\\x1b[(]B)?\\x1b\\[(0;)?(37)?m", "color": "#c7c7c7"},
{"scope": "white", "code": "(\\x1b\\(B)?\\x1b\\[(0;)?(37)?m", "color": "#c7c7c7"},
I pre-pened the original string (which should match the \033[m
) and added (\\x1b[(]B)?
or (\\x1b\\(B)?
to detect the leading part.
This technique is no effective, do you have any idea ? Thanks a lot!
Can you send the whole output string?
tput sgr0 > reset_str
outputs (visualized using vim or less): ^[(B^[[m
.
I suppose ^[
stand for the ESC
character (decimal 27, hex 0x1B, octal 033) so the string would be (char separated by commas) ESC, (, B, ESC, [, m
. One of the tool I use ouputs each lines with this sequence.
According to this site the ESC ( B
sequence seems to be used for "Set United States G0 character set" -> nothing to do for SublimeANSI. So I ended up forking SublimeANSI and tried to add this code as unsupported (see this commit).
First it seemed to work, but finally I may not have installed the ANSIescape package properly from my github repo and I can not test anymore...
Currently this plug-in does not support codes for VT100 terminal. It deletes only the commands from this list.
I plan to rewrite some part of this plugin in near future (hope to find some time). I think all regexps should be set up in ANSI settings, so everybody would be able to add any other ANSI character without changing the code.
The lines you edited could be removed in the future since they are probably not necessary (need to test it). Your edits works, because it changes the ANSI VT100 code to the one that will be deleted later.
Adding the codes for deletion should be done in line 164 (for on_finish
trigger) and in line 325 (on_data
trigger).
Yes! It would be great that settings allow users to define ignored/unsupported codes via regex.
I may have the time to submit a pull request in this way tonight if I find the way to test my development on my computer.
Is it supposed to work (the ANSIescape package) directly once copied on the Package directory ? The installation through "package control" worked for me but this way no...