How about stripping nulls out of any error messages coming from Jansi?

(Shameless plug) Every java main() method deserves http://picocli.info

> On Feb 9, 2018, at 5:03, Gary Gregory <[email protected]> wrote:
> 
> It might be a bug in JAnsi's WindowsSupport.getLastErrorMessage()
> 
> Gary
> 
> On Thu, Feb 8, 2018 at 12:42 PM, Ralph Goers <[email protected]>
> wrote:
> 
>> Maybe this is a silly question, but in what world is it rational to have
>> NULL chars in the middle of a String?
>> 
>> Ralph
>> 
>>> On Feb 8, 2018, at 10:24 AM, Gary Gregory <[email protected]>
>> wrote:
>>> 
>>> In some cases I get:
>>> 
>>> 2018-02-08 10:14:49,488 main WARN Unable to instantiate
>>> org.fusesource.jansi.WindowsAnsiOutputStream due to java.io.IOException:
>>> Could not get the screen info: T
>>> 
>>> What you do not see above is that on the console there is more after the
>>> "T". There is a NUL character and "h e   h a n d l e   i s   i n v a l i
>> d
>>> ." which probably contains more NUL chars since I cannot cut and copy
>> that
>>> string.
>>> 
>>> If I cut and paste my Eclipse console, the only text I get is the above,
>>> not the whole console, due to the NUL char.
>>> 
>>> I am thinking that I should create a configuration for that one logger
>>> " org.fusesource.jansi.WindowsAnsiOutputStream"
>>> and strip out NULs. I am not sure how I can do that on a regular logger,
>>> even less the status logger.
>>> 
>>> Do we want to take the hit to scan all status logger string messages for
>>> NULs and replace them with SPACEs or skip them. I also am not crazy about
>>> adding yet another option.
>>> 
>>> Thoughts?
>>> 
>>> This seems important (to me) since these kinds of messages come from the
>> OS
>>> and we do not have control over them.
>>> 
>>> Gary
>> 
>> 
>> 

Reply via email to