removing ansi control escape characters from a string

2013-05-31 Thread Timothee Cour
Not sure this is the right forum but here we go: When using unix command 'script' to log the terminal input/output commands, it includes special ansi control escape characters. I'd like to filter out the generated script file from those character sequences, so that it preserves the content

Re: removing ansi control escape characters from a string

2013-05-31 Thread Adam D. Ruppe
On Saturday, 1 June 2013 at 01:08:46 UTC, Timothee Cour wrote: removes escape codes for coloring, etc. Getting all these is a very difficult task because the escape sequences aren't all well defined. But, you should get pretty good results by just filtering out anything that starts with

Re: removing ansi control escape characters from a string

2013-05-31 Thread Adam D. Ruppe
On Saturday, 1 June 2013 at 01:08:46 UTC, Timothee Cour wrote: string; also the behavior of backspace needs to be emulated. oops I missed this on my fires readthrough. But if instead of if(c == 8) continue, you did if(c == 8){ outputString = outputString[0 .. $-1]; continue;} that should be