<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Garamond,Georgia,serif;" dir="ltr">
<p>Hi,</p>
<p><br>
</p>
<p>I have to report a bug and its plausible solution. I read the contributing guidelines and tried signing up on salsa.debian.org, however the OAuth with GitLab was failing and form registration requires approval so I will wait for that. Once I am in, I will
also post it there if asked for <span>😊</span></p>
<p><br>
</p>
<p><b>Bug</b></p>
<p><b><br>
</b></p>
<p>The Procyon decompiler which is used as a comparator for diff-ing Java bytecode outputs the decompiled version with ANSI color code by default. I assume this output is taken as input by diffoscope to produce the diff. Hence, the final diff also has decompiled
Java code with syntax highlighting in the terminal.</p>
<p><br>
</p>
<p>I wanted this diff in a plain text file without ANSI colour codes so I tried using option `--text-color never`. This removed the colours from '+' and '-' which are green and red respectively. However, the synatx highlighting was still there. This happens
because `ProcyonDecompiler` comparator by default outputs the decompiled Java code with syntax highlighting.</p>
<p><br>
</p>
<p><b>Reproduce</b></p>
<p><b><br>
</b></p>
<p><span style="font-family: Consolas, Courier, monospace;">diffoscope A.class B.class</span></p>
<p><span style="font-family: Garamond, Georgia, serif;">> files are attached<br>
</span></p>
<p><br>
</p>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, "EmojiFont", "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<div id="m_4935352394101912768Signature">
<div name="divtagdefaultwrapper"><font size="2" color="#808080"><span style="font-family:Arial,"Helvetica Neue",helvetica,sans-serif; background-color:rgb(255,255,255)"><span id="divtagdefaultwrapper" style="font-size:12pt">
<div style="margin-top:0; margin-bottom:0"><span style="color:rgb(0,0,0); font-family:Garamond,Georgia,serif"><img size="0" contenttype="image/png" style="" id="img683371" contextid="img7294" tabindex="0" height="180" width="190" sizeoption="small" src="cid:cc73313f-ea27-48dc-a4d7-e4ef98f91ad7"><br>
</span></div>
<div style="margin-top:0; margin-bottom:0"><span style="color:rgb(0,0,0); font-family:Garamond,Georgia,serif"><br>
</span></div>
<div style="margin-top:0; margin-bottom:0"><span style="color:rgb(0,0,0); font-family:Garamond,Georgia,serif">As you can see the output is syntax highlighted which is expected in this case.</span></div>
<div style="margin-top:0; margin-bottom:0"><span style="color:rgb(0,0,0); font-family:Garamond,Georgia,serif"><br>
</span></div>
<div style="margin-top:0; margin-bottom:0"><span style="color: rgb(0, 0, 0); font-family: Consolas, Courier, monospace;">diffoscope --text-color never A.class B.class<br>
</span></div>
<div style="margin-top:0; margin-bottom:0"><span style="color:rgb(0,0,0); font-family:Garamond,Georgia,serif"><br>
</span></div>
<div style="margin-top:0; margin-bottom:0"><span style="color:rgb(0,0,0); font-family:Garamond,Georgia,serif"><img size="0" contenttype="image/png" style="" id="img529488" contextid="img503679" tabindex="0" height="180" width="190" sizeoption="small" src="cid:60f431d6-3324-4496-ac85-7adc1430de54"><br>
</span></div>
<div style="margin-top:0; margin-bottom:0"><span style="color:rgb(0,0,0); font-family:Garamond,Georgia,serif"><br>
</span></div>
<div style="margin-top:0; margin-bottom:0"><span style="color:rgb(0,0,0); font-family:Garamond,Georgia,serif">I would expect that syntax highlighting is also not present here. It only removes ANSI code for `+` and `-`.</span></div>
<div style="margin-top:0; margin-bottom:0"><span style="color:rgb(0,0,0); font-family:Garamond,Georgia,serif"><br>
</span></div>
<div style="margin-top:0; margin-bottom:0"><span style="color:rgb(0,0,0); font-family:Garamond,Georgia,serif"><b>Solution</b></span></div>
<div style="margin-top:0; margin-bottom:0"><span style="color:rgb(0,0,0); font-family:Garamond,Georgia,serif"><b><br>
</b></span></div>
</span></span></font>
<ol style="margin-bottom: 0px; margin-top: 0px;">
<li><font size="2" color="#808080"><span style="font-family:Arial,"Helvetica Neue",helvetica,sans-serif; background-color:rgb(255,255,255)"><span id="divtagdefaultwrapper" style="font-size:12pt"></span></span></font><span style="font-family: Garamond, Georgia, serif;">Procyon
provides flag `</span><span style="font-family: Garamond, Georgia, serif;"> --output-directory</span><span style="font-family: Garamond, Georgia, serif;">` which outputs the decompiled source into a file without any syntax highlighting. We could use this option
for the decompiler if `--text-color</span><span style="font-family: Garamond, Georgia, serif;">` is set to never or `--text` has a file path.</span></li><li><span style="font-family: Garamond, Georgia, serif;">We ask procyon to have an option which outputs without syntax highlighting on terminal.</span></li><li><span style="font-family: Garamond, Georgia, serif;">We use regex to remove all ANSI codes while processing the diff in diffoscope.</span><br>
</li></ol>
<font size="2" color="#808080"><span style="font-family:Arial,"Helvetica Neue",helvetica,sans-serif; background-color:rgb(255,255,255)"><span id="divtagdefaultwrapper" style="font-size:12pt">
<div style="margin-top:0; margin-bottom:0"><span style="color:rgb(0,0,0); font-family:Garamond,Georgia,serif"> <br>
</span></div>
<div style="margin-top:0; margin-bottom:0"><span style="color:rgb(0,0,0); font-family:Garamond,Georgia,serif">Regards,</span></div>
<span style="font-family:Garamond,Georgia,serif"></span><span style="font-family:Garamond,Georgia,serif"></span><span style="color:rgb(0,0,0)"></span><span style="font-family:Garamond,Georgia,serif"></span><span style="font-family:Garamond,Georgia,serif"></span>
<div style="margin-top:0; margin-bottom:0"><span style="color:rgb(0,0,0); font-family:Garamond,Georgia,serif">Aman Sharma</span></div>
</span><br>
</span></font></div>
<div name="divtagdefaultwrapper"><font size="2" color="#808080"><span style="font-family:Arial,"Helvetica Neue",helvetica,sans-serif; background-color:rgb(255,255,255)"></span><span class="im">PhD Student<br style="font-family:Arial,"Helvetica Neue",helvetica,sans-serif">
<span style="font-family:Arial,"Helvetica Neue",helvetica,sans-serif; background-color:rgb(255,255,255)">KTH Royal Institute of Technology</span><br style="font-family:Arial,"Helvetica Neue",helvetica,sans-serif">
</span><span style="font-family:Arial,"Helvetica Neue",helvetica,sans-serif; background-color:rgb(255,255,255)">School of Electrical Engineering and Computer Science (EECS)</span><br style="font-family:Arial,"Helvetica Neue",helvetica,sans-serif">
<span style="font-family:Arial,"Helvetica Neue",helvetica,sans-serif; background-color:rgb(255,255,255)">Department of Theoretical Computer Science (TCS)</span><br style="font-family:Arial,"Helvetica Neue",helvetica,sans-serif">
<span style="font-family:Arial,"Helvetica Neue",helvetica,sans-serif; background-color:rgb(255,255,255)"><a href="http://www.kth.se" target="_blank" id="LPNoLP"></a><a href="https://www.kth.se/profile/amansha" class="OWAAutoLink" id="LPNoLP"></a><a href="https://www.kth.se/profile/amansha" class="OWAAutoLink" id="LPNoLP"></a></span></font></div>
</div>
<a href="https://www.kth.se/profile/amansha" class="OWAAutoLink" id="LPNoLP"><span style="font-size:10pt"></span></a><a href="https://algomaster99.github.io/" class="OWAAutoLink" id="LPNoLP">https://algomaster99.github.io/</a><br>
</div>
</div>
</div>
</body>
</html>