Closed ironfish closed 10 years ago
It looks like you are using sbt 0.13.6. I am also using that version and I don't see the problem you are reporting. This would suggest to me that it's a difference between our setups somehow, but I don't know what would be causing it.
Can you try with other versions of sbt to see if the problem occurs with those too?
Actually I'm using SBT 0.13.5. I changed to SBT 0.13.6 and have the same problem. Are there any plugins that you are aware of that might cause this problem? Also I'm using the latest DEV build of sublime text 3 - 3064.
I am using the same version of sublime. I am not aware of any plugins that could cause this. SublimeSBT passes the output through from the shell, so it is likely that the escape sequences are coming from your shell. Can you look at whether your shell settings are causing this output?
The SublimeSBT output processing does try to remove escape sequences with this code:
return re.sub(r'\033(?:M|\[[0-9;]+[mK])', '', line)
It would appear that this does not manage to remove the ones you are seeing.
I user Powerline on OSX. Do you think that could be causing the problem?
Actually I just disabled powerline and still have the problem.
Can you capture the output so we can see exactly what it is? It seems that this sequence of characters is not filtered by what SublimeSBT is trying. Maybe we can just adjust that filtering.
E.g., run the "script" command then run sbt inside that sub-shell. Once you exit script you should have a file with the output in it. Then post the output of "od -c file" where "file" is the one that script created.
Here's the "od -c file" results where file was the name of the output from the script command. 0000000 25427 26994 29808 29472 24948 29810 25701 28448 0000020 8302 24915 8308 25939 8304 12338 12832 14897 0000040 13365 13370 8249 12338 13361 6922 16219 12337 0000060 13363 25192 29537 11624 11827 9266 29472 29794 0000100 25376 28015 26992 25964 2573 29525 8293 26223 0000120 32288 11823 25203 25460 28271 26982 8295 29545 0000140 25632 28773 25970 24931 25972 11364 28704 25964 0000160 29537 8293 26989 29287 29793 8293 27751 25199 0000200 27745 29472 29797 26996 26478 8307 28532 12064 0000220 29557 12146 28524 24931 12140 29797 12131 25203 0000240 28532 29808 3443 6922 12379 23405 23323 27952 0000260 28265 28518 23323 27952 8285 23323 27952 28492 0000300 25697 28265 8295 29296 27247 25445 8308 25956 0000320 26982 26990 26996 28271 26144 28530 8301 21807 0000340 25971 29554 18735 28530 26222 29545 12136 28503 0000360 27506 28787 25441 12133 27489 24939 28717 29285 0000400 26995 29811 28261 25955 24879 27499 11617 25968 0000420 29554 29545 25972 25454 11621 28525 26478 12143 0000440 29296 27247 25445 7028 12379 3437 6922 12379 0000460 23405 23323 27952 28265 28518 23323 27952 8285 0000500 23323 27952 25939 8308 30051 29298 28261 8308 0000520 29296 27247 25445 8308 28532 29216 28527 8308 0000540 26920 8302 30050 27753 8292 26982 25964 12090 0000560 29525 29285 12147 29257 28271 26982 26739 22319 0000600 29295 29547 24944 25955 24879 27499 11617 25968 0000620 29554 29545 25972 25454 12133 27489 24939 28717 0000640 29285 26995 29811 28261 25955 27949 28271 28519 0000660 10543 23323 27952 2573 23323 27952 7003 13147 0000700 27954 30067 25443 29541 7027 12379 23917 6944 0000720 12379 21613 29807 27745 29728 28009 14949 12576 0000740 29472 8236 28515 28781 25964 25972 8292 25939 0000760 8304 12338 8236 12338 13361 14624 13626 14901 0001000 12593 20512 6989 12379 3437 25098 29537 11624 0001020 11827 9266 25888 27000 3444 25866 27000 3444 0001040 2570 25427 26994 29808 25632 28271 8293 28271 0001060 21280 29793 21280 28773 12832 8240 12594 13626 0001100 14901 12341 12832 12592 2612 0001112
Are you sure that's from "od -c". I would expect to see the printable characters whereas this seems to just be from "od". The file itself didn't seem to come through.
Sorry about that, thought I had the -c flag: 0000000 S c r i p t s t a r t e d o 0000020 n S a t S e p 2 0 2 1 : 0000040 5 4 : 4 9 2 0 1 4 \n 033 [ ? 1 0 0000060 3 4 h b a s h - 3 . 2 $ s b t 0000100 c o m p i l e \r \n U s e o f 0000120 ~ / . s b t c o n f i g i s 0000140 d e p r e c a t e d , p l e 0000160 a s e m i g r a t e g l o b 0000200 a l s e t t i n g s t o / 0000220 u s r / l o c a l / e t c / s b 0000240 t o p t s \r \n 033 [ 0 m [ 033 [ 0 m 0000260 i n f o 033 [ 0 m ] 033 [ 0 m L o 0000300 a d i n g p r o j e c t d e 0000320 f i n i t i o n f r o m / U 0000340 s e r s / I r o n f i s h / W o 0000360 r k s p a c e / a k k a - p e r 0000400 s i s t e n c e / a k k a - p e 0000420 r s i s t e n c e - m o n g o / 0000440 p r o j e c t 033 [ 0 m \r \n 033 [ 0 0000460 m [ 033 [ 0 m i n f o 033 [ 0 m ] 0000500 033 [ 0 m S e t c u r r e n t 0000520 p r o j e c t t o r o o t 0000540 ( i n b u i l d f i l e : / 0000560 U s e r s / I r o n f i s h / W 0000600 o r k s p a c e / a k k a - p e 0000620 r s i s t e n c e / a k k a - p 0000640 e r s i s t e n c e - m o n g o 0000660 / ) 033 [ 0 m \r \n 033 [ 0 m [ 033 [ 3 0000700 2 m s u c c e s s 033 [ 0 m ] 033 0000720 [ 0 m T o t a l t i m e : 1 0000740 s , c o m p l e t e d S e 0000760 p 2 0 , 2 0 1 4 9 : 5 5 : 0001000 1 1 P M 033 [ 0 m \r \n b a s h - 0001020 3 . 2 $ e x i t \r \n e x i t \r 0001040 \n \n S c r i p t d o n e o n 0001060 S a t S e p 2 0 2 1 : 5 0001100 5 : 5 0 2 0 1 4 \n 0001112
Thanks. In this transcript it seems that the shell or terminal is sending 033 [ ? 1 0 3 4 h before the prompt is displayed (perhaps with some embedded spaces; it's hard to tell from the transcript).
All of the other escape sequences are of the form 033 [ 0 m which will be successfully stripped by the SublimeSBT code. These ones are setting/resetting colours, I believe.
I suppose we can extend what SublimeSBT is doing to strip this new escape sequence as well, but I'm not sure this is a scalable approach since there are many escape sequences that are not handled at present. It may not be feasible to reliably strip them all.
In fact, a short investigation on the net didn't result in a description of what the purpose of this sequence is. It seems to be coming from your bash setup so perhaps there is a configuration option for bash that will turn it off. I'm not that familiar with bash so I can't recommend anything at this stage.
Okay - I appreciate your help. What's interesting is that I don't see these characters with the Sublime Shell Command Plugin or Shell Turtlestein. Below is a screen shot of Sublime Shell Command Plugin.
No problem (I'm not sure I really helped much :-).
I took a quick look at Shell Command and Shell Turtlestein; they seem to use subprocess.Popen to run their commands, so presumably the escape sequences are not produced when piping to/from the process.
I also looked at SublimeREPL which contains this code:
if self._filter_color_codes:
unistr = re.sub(r'\033\[\d*(;\d*)?\w', '', unistr)
unistr = re.sub(r'.\x08', '', unistr)
This is a more general pattern of escape sequence removal than SublimeSBT does at the moment and seems like it would fix your problem. Perhaps we should just go with that...
I think that makes sense.